Two things about my website beforehand: (1) my site is 100% static (including HTML) and (2) my site only gets updated on Saturday. I also use the ‘cache everything’ feature.
Now what would be most beneficial to my website speed?
- Set the HTML caching to 1 hour. That way when I update in the weekend, people see the new HTML quickly.
- Cache the HTML till next Saturday with the
cache-controlheader. That way everyone who visits the website during the week has a chance to do so from their browser cache (if they visited earlier in the week).
In theory option 2 is quicker. But Cloudflare’s data centres also maintain their cache on a FIFO basis, with assets that are requested less stored less long in the cache. So when I cache the HTML more aggressively the odds of cache MISS are greater (because my files will be requested less). That would in the end give more roundtrips to the origin server, and that’s something I hope to avoid.
What are your thoughts?