I can't answer for how CloudFlare works, but mod_pagespeed
can optimize images in two different ways:
- Rewrite image URLs found in HTML or CSS statically on a page. In this case the URL itself will be rewritten to something like
ximage.png,qk1-v1&k2=v2.pagespeed.ic.Hash.png
. And that URL will be served optimized. InPlaceResourceOptimization
, where the image is rewritten and served from the original URL. As you can see from the documentation, this feature is only available for the Apache-version ofmod_pagespeed
. We are working on porting it to the the Nginx versions.
In general, the first method is more effective, are these URLs not found statically in HTML? Are they dynamically generated in JS?