I’m attempting to force caching on Rest API paths, ignoring no-cache or similar headers. I’ve set up a page rule to cache everything, as I saw in a previous post, but this didn’t seem to do anything.
you probably wanted to match both Schemes “HTTP” and “HTTPS” by implementing the asterisk at the begining, but that would match ALL subdomains that ends with “api” (basically ALL subdomains that do not exist if you have the DNS subdomain wildcard) and does not match this one.
If you want to match both schemes, just leave the scheme away, like api.warframestat.us/* as this then matches both schemes.
So since you anyway just deliver content on the HTTPS scheme please always set the “Cache Everything” rules to HTTPS
You’re welcome! Hope you like this community
If yes, please subscribe and leave a like xD
Just feel free to set the Edge Cache TTL to one month, and instead better trigger an API request to clear the URLs, everytime the content changes. This will be way better
In worst case you can trigger the API by a 2 min cron. But please invalidate cache just on changes. Thats always the best case.
Please don’t go for the 2min-cron, way better is to invalidate on a change-event if you can hook into it.
I’m going for over 2 minutes for now, but that coincides with the other cron I already have for updating the specific endpoints that update that fast. I did a purge everything, and that’s working.
If you already update your content with a cron, just append the PurgeScript with a ‘&&’ to it, so it runs after the first script/command exited successfully.
something like this:
*/5 * * * * bash -c 'command1 && command2'
or
*/5 * * * * /bin/bash -c 'command1 && command2'
After this, wait untill you are 100% certain the content did update and see it the change also gets reflected on Cloudflare.