Issue #5 new

Add path-based GZIP option for CDN caching on AWS

Stephen McKamey
repo owner created an issue

Since CDNs like AWS CloudFront do not cache resources varying by headers (since it only supports HTTP/1.0), it would make sense to include an optional mechanism to insert a token in the URL for GZIPd resources to enable caching both versions. This way if the very first request doesn't accept GZIP everyone else doesn't have to pay the bloated price, and if a non-GZIP userAgent comes along later it isn't effectively sent a garbage response.

For example, if the page is requested accepting GZIP, then point to CDN resources which have a {{{.gz.css}}} or {{{.gz.js}}} style URL. Within the CDN directory only, it should recognize this special URL format and specifically remove the "{{{.gz}}}" token, ensure the proper accept-encoding header is present, and serve with the GZIP filter applied. Otherwise, no compression filter should be added.

Comments (0)

  1. Log in to comment