Skip to content
Vacuum Image Optimizer1.2.2
1.2.22 min read

Frontend Delivery

Serve generated WebP or AVIF files on the frontend while preserving original fallback behavior.

Frontend Delivery lets visitors receive generated modern formats when available. Existing installations keep the feature disabled until an administrator enables it from Compression settings.

Delivery model

Vacuum uses wp_get_attachment_image_attributes and wp_calculate_image_srcset with the attachment ID and exact source file. After a successful optimization pass, it can generate WebP and AVIF derivatives for the full image and each registered WordPress size. Each srcset candidate is resolved independently, so a full-size derivative is never reused for a smaller candidate.

The resolver validates the upload-owned source, MIME type, dimensions, recorded byte size, and derivative file before returning a URL. When a tracked derivative is stale, Vacuum can regenerate it through a temporary file and atomic replacement. It never converts an image during anonymous frontend rendering.

Preferred format

PreferenceBehavior
AutoPrefer AVIF when accepted and available, then WebP, then original.
AVIFPrefer AVIF with original fallback.
WebPPrefer WebP with original fallback.

Auto negotiation parses image format tokens without case sensitivity and honors q quality values. A format with q=0, an invalid derivative, or no acceptable candidate is not served.

Browser and cache negotiation

The response sends Vary: Accept so compliant page caches and CDNs can keep negotiated output separate. Configure caches to honor that header or include Accept in their cache key. Purge affected caches after enabling delivery or regenerating derivatives; Vacuum does not purge third-party caches automatically.

Safety

Stored media URLs in post content are not permanently rewritten. Missing, stale, unreadable, invalid, or oversized derivatives fall back to the original WordPress image immediately. If frontend delivery is disabled, normal original output returns without cleanup or a database migration.

Responsive derivatives are validated against the upload-owned source and the expected MIME type and dimensions. Concurrent requests use per-output locks, and repeated metadata updates preserve valid files and registry timestamps instead of regenerating them.

Related articles