Photon: images with query strings, lacking appropriate caching headers, etc.
-
Photon is great. Automattic is very generous in allowing us to store so many images for free on their CDN.
But they could help themselves to reduce the actual bandwidth and the requests coming to their own servers. How? By handling headers correctly and possibly serving scaled images using a different URL (avoiding proxy/caches to tag the URL with an “?” as a query and thus disabling its caching).
I’ve been doing some evaluation tests using Google’s PageSpeed algorithms. Almost all images served through Photon:
- are dynamically resized with query strings (e.g. the following gets appended to each image: ?resize=1532%2C993 [as an example]). This means that the original image is transferred in full (which is overkill and lowers the PageSpeed ranking) and forces the browser to do the resizing, and, at the same time, since it looks like a query, many proxy/caches will not cache it (another notch going down PageSpeed)
- are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. A Last-Modified or ETag header should be added (very easy to do on Photon’s side)
- could be stored in many cases with lossless compression, which would also shrink its size in some cases (again, this lowers the PageSpeed ranking — browsers, to get the same image, will need to fetch larger files
At least point 2 should be very easy to implement.
Just my .02 ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Photon: images with query strings, lacking appropriate caching headers, etc.’ is closed to new replies.