PixSpeed Serving Modes Explained: Picture Tag vs Server Rewrite vs URL Swap

Which PixSpeed serving mode should you use? How Picture tag, Server rewrite and URL swap differ, how each interacts with page caches, and the fastest option for nginx and Apache hosts.

receives <picture> <source>

This is the default for a reason: if you do not want to think about serving, stop reading and keep this mode.

Mode 2 — Server rewrite (fastest)

Accept Apache and LiteSpeed nginx Help tab # /etc/nginx/conf.d/wac-serve.conf map $http_accept $wac_img_ext { default ''; '~*image/avif' '.avif'; '~*image/webp' '.webp'; } # inside each server { } block of your site: location ~* ^(?<wac_img_path>/wp-content/uploads/.+)\.(jpe?g|png|gif)$ { expires 30d; access_log off; add_header Vary Accept; try_files $wac_img_path$wac_img_ext $uri =404; } nginx -t Vary: Accept

Mode 3 — URL swap (legacy)

The oldest trick: PixSpeed rewrites image URLs inside your HTML to point directly at the variant files. It works everywhere and needs no server changes, but the HTML now differs per capability — and unless your cache is Accept-aware, a cached page can serve stale URLs after a bulk conversion. If you use this mode, purge your page cache after converting (the dashboard button handles FlynCache in one click). It is kept for compatibility; new sites should use Picture tag or Server rewrite.

Side-by-side comparison

Picture tagServer rewriteURL swap
Config neededNone.htaccess (auto) / nginx snippetNone
Page-cache safeYes — HTML identicalYes — HTML identicalPurge after bulk runs
HTML weightSlightly larger (sources added)UnchangedUnchanged
DeliveryBrowser picks formatServer picks formatURL rewritten
Best forEveryone, managed hostsVPS/dedicated, max speedLegacy setups

How to choose in 10 seconds

Always verify after switching

serving test troubleshooting guide FlynCache Purge support

Frequently asked questions

Can I switch serving modes later?

Yes, any time, without re-converting anything. Serving mode only decides how variants are delivered — the generated .webp and .avif files are identical regardless of the mode.

Does the Picture tag mode hurt SEO?

No. Alt text, dimensions, srcset and lazy loading are preserved, and search engines index the original file exactly as before. Google explicitly documents the picture element as a valid way to serve next-gen formats.

Which mode is best on nginx hosting?

Server rewrite is the fastest if you can edit the server config — copy the map and location snippet from the PixSpeed Help tab into your nginx configuration, test with nginx -t and reload. If you cannot touch server config, Picture tag is the better pick: zero config, fully cache-safe.