I’ve contacted the support about this, and here is the final considerations:
CloudFlare doesn’t support serving “stale-while-revalidate” in ANY way;
Stale cache is only used in case a second request comes at the same time, before the first had the chance to generate a fresh page;
You can’t change this using the API either, because there’s no way to serve stale content at all (even with a worker);
They plan on implementing this feature, but again, no ETA. The only official response from the engineering team is that “this is too complex to be done” and is not a priority right now.
Other CDNs (like Fastly) already support SWR flag. Nginx itself has the “proxy_background_update” option, so i really don’t get why CF haven’t done it before.
For a huge site like mine (over 100k pages), it’s the only way to serve 100% cached pages on the edge. Exporting the entire site everytime we make a minor change in one of our scripts is simply not viable.
This would be a very important feature to increase SEO score and to make the website more reliable.