Caching semi-static pages with Cloudflare

I would like to cache some semi-static pages with Cloudflare and I was wandering what is the best strategy (for “semi-static page” I mean something that may change sometimes, but not very often),

In particular I have a web app that hosts an online menu for thousands of restaurants. Each restaurant has its own single-page menu, for example:

A page only changes when:

  • a restaurant updates something in their menu
  • we release a new version of the web app

I would like to cache those semi-static pages as much as possible in Cloudflare and avoid hitting the server (or in any case reduce its work using revalidation instead of complete responses).

The problem is that an update should appear almost immediately (for example, I cannot cache a page for 1 hour before refreshing it).


Cache-control: public, must-revalidate

Does that mean that Cloudflare will cache the page and use etags for revalidation before returning every request to the browser? Is the right choice for the above scenario?

Can I change it to allow CF to revalidate in background and return the response immediately?


Is there any cache-control directive to cache the pages only in Cloudflare (e.g. for several hours) and not in the browser?

Then I could use the API to invalidate the CF cache whenever an update occurs.

In this way the browsers always requests a fresh copy, Cloudflare returns the response without contacting the origin server and the cache is invalidated immediately from API whenever a change happens.

Is this a wise choice for the scenario above?
What cache-control should I use for this case?


  1. I don’t know if Cloudflare uses etags. I suspect it just compares its cache with what’s on the server. I find this to be relatively slow.
  2. Page Rules’ Edge Cache TTL controls Cloudflare’s cache. This is often used on conjunction with Cache Level: Everything. This is what I usually go with, as it’s quite fast and won’t require a Revalidate.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.