πŸ“– Lesson 8 of 13

Optimizing Image & Font Assets

Performance and optimization are core pillars of WP Rig. In this lesson, we will explore how WP Rig handles automatic image compression and how to configure privacy-first, locally-hosted web fonts.


1. Automatic Image Compression via `sharp`

High-resolution images are the biggest contributor to slow page weights and poor Core Web Vitals. WP Rig resolves this by integrating **sharp** β€” an extremely fast, high-performance Node.js image processing library powered by `libvips`.

How the Pipeline Works

During builds or development watch runs, WP Rig automatically: 1. **Compresses & Minifies:** Compresses image sizes while preserving visual quality. 2. **Performs Lossless Auditing:** Truncates metadata profiles and converts assets. 3. **Generates Optimized Output:** Outputs compressed images straight to `assets/images/` as production-ready artifacts.

Triggers


2. Privacy-First Google Fonts Integration

Loading fonts directly from Google’s CDNs (`fonts.googleapis.com`) violates GDPR compliance regulations and triggers external network connection delays. WP Rig uses a **locally-hosted, privacy-first font loader**.

The Font Downloading Engine

How to Configure Custom Fonts

By serving your images and web fonts locally from your host server, you guarantee maximum performance, perfect GDPR compliance, and sub-second page rendering!