Inicio - Documentación - POM Cache - 10 Help - WebP is not served

WebP is not served

POM Cache does not generate WebP images. Its optional Apache approach can rewrite an original image request to a same-folder WebP alternative when that alternative already exists and the client advertises WebP support.

For example, a request for:

/uploads/2026/07/dish.jpg

can use:

/uploads/2026/07/dish.jpg.webp

The original remains the fallback.

Confirm the WebP file exists

Check that:

  • the original image exists;
  • the .webp alternative exists in the same directory;
  • its name includes the complete original filename and extension before .webp;
  • Apache can read both files;
  • the WebP file is a valid image.

POM Cache will not create a missing alternative. Use the site's image-processing workflow for generation.

Test content negotiation

In the browser Network panel, inspect the image request. The request's Accept header must include WebP support.

Compare a request that accepts WebP with one that does not. The first should receive WebP bytes and the second should receive the original format. Confirm the actual Content-Type, not just the URL or filename.

The server needs the correct WebP MIME mapping:

image/webp

Verify the Apache rule

Confirm that the installed rule:

  • is active for the uploads directory and virtual host;
  • runs before WordPress fallback rules;
  • checks the client's WebP capability;
  • checks that the same-folder .webp file exists;
  • rewrites internally without changing the public image URL;
  • preserves the original when any condition fails.

Validate Apache syntax after editing. POM Cache cannot update a copied server rule simply because a WordPress setting changed.

Preserve Vary: Accept

Because the public URL can return WebP or the original bytes, intermediary caches need to distinguish the negotiation. Confirm that the response includes an appropriate:

Vary: Accept

and that the CDN's cache policy respects the chosen variation strategy.

Without correct variation, a non-WebP client may receive WebP or a WebP-capable client may keep receiving the original.

Test without the CDN

Prove the origin rewrite first. If origin works but CloudFront does not:

  • review the behavior for media paths;
  • review whether Accept participates in forwarding or cache-key policy;
  • invalidate the exact image URL after creating the .webp alternative;
  • inspect the edge cache status and response Content-Type.

CloudFront can also perform its own image or compression behavior depending on the wider platform. Make sure only one documented layer owns format negotiation.

Expected fallback

Returning the original file is correct when:

  • the browser does not advertise WebP;
  • the alternative does not exist;
  • the rewrite rule is not deployed for that path;
  • file or MIME checks fail.

Do not make the original unavailable. A graceful fallback protects unsupported clients and prevents broken media while WebP generation is incomplete.