Re:Google, Microsoft, Qualcomm and Baidu Announce Joint Inve...
by trashcan on Tuesday September 22, 2015 @01:35PM
(#10260193)
It looks like they determine whether or not the content is static by the extension:
https://support.cloudflare.com/hc/en-us/articles/200172516-W...
"CloudFlare does not cache by MIME type at this time."
And most likely default to not caching if they are unable to determine.
For dynamic pages you can tell them which ones can be safely cached with PageRules (on paid plans): https://support.cloudflare.com/hc/en-us/articles/200172826-C...
Do you know of any docs describing the algorithm Akamai or CloudFlare use to decide whether to hit your origin server? I'm a stickler for correctness but it seems to be pretty easy to get into the situation where your users aren't getting what you intended. HTTP cache headers are a mess.
To me it seems safer to code your application so the HTML points to JS/CSS/PNG with content hashes in the URL. Then you don't have any cache expiry issues -- nothing ever expires, but you control the assets exactly through your dynamic HTML.
I think it's important to have fast and reliable rollbacks. You can imagine some situation where private content or offensive text is accidentally included with some static asset... I would like some guarantee about when users stop seeing it (preferably as soon as the application is redeployed).