I see many post about how to avoid caching 404, and most will be replied with this article https://support.cloudflare.com/hc/en-us/articles/200172516-Understanding-Cloudflare-s-CDN#h_51422705-42d0-450d-8eb1-5321dcadb5bc as a link, meanwhile pointing out that a 404 should be cached only for 3 minutes.
But this is not true.
Some of our users can not load our website for some js files hit the 404 cache, even one day later after they feedback the issue. We have to purge the 404 cache files which is annoying because there are many js files and we do not want to purge all our resources.
I don’t know why the 404 caches are not expired after 3 minutes like the official document’s statement. Maybe because I set the page rule and set the Edge Cache TTL one month? I did not set any cache info in the response header.
So could anyone please provide a way to avoid cache 404 for long time? For our website is built with react, if the js file is missing, the website can not load normally.
Thanks very much.