Hacker News new | ask | show | jobs
by robbles 4844 days ago
One limitation to this setup is that CloudFlare only caches CSS, JS, and images. It won't cache HTML or other dynamic content by default.

However, it IS possible to "trick" CloudFlare into caching this content, by abusing the way it looks at the file extension and headers returned from your servers. If you can find a way to serve all your markup as JSON / JSONP with a ".js" extension and proper caching headers, it will treat it the exact same as a static JavaScript file.

You can do this easily enough with a build/deploy script that sets the right headers in S3 metadata so that CloudFlare receives them with caching headers (Cache-Control, ETag, Expires, etc.)

1 comments

You can add a page rule for your whole domain and set custom caching to "everything".