Accept-Encoding, It's Vary important. - MaxCDN Blog
Imagine two clients: an old browser without compression, and a modern one with it. If they both request the same page, then depending on who sent the request first, the compressed or uncompressed version would be stored in the CDN. Now the problems start: the old browser could ask for a regular "index.html" and get the cached, compressed version (random junk data), or the new browser could get the cached, uncompressed version and try to "unzip" it. Bad news, either way.
The fix is for the origin server to send back Vary: Accept-Encoding. Now the intermediate CDNs will keep separate cache entries (one for Accept-encoding: gzip, another if you didn't send the header). These days you're unlikely to have clients without compression, but why risk cache mixups?
Read full article from Accept-Encoding, It's Vary important. - MaxCDN Blog
No comments:
Post a Comment