I am trying to purge the cache for specific URLs, following your API guidelines, but the cache is not getting purged.
This is the general setup
- we are caching api calls on the backend using page rules (see attached screeshot)
- we are expiring these caches from our backend (via your API) when things change
- we are considering the url params as a part of the cache “?xxxxx”
Here is what we’re sending (in sudo-code):
post(
‘https://api.cloudflare.com/client/v4/zones/[xxxx]/purge_cache’,
files: [{:url=>“https://api.theapp.com/api/v1/cdn/page_rules?website_id=144&url=https%3A%2F%2Fwww.testdomain.com.com%2Fprivacy-policy%2F”}]
)
and the result I get from your API
=> {“result”=>{“id”=>“[xxxx]”}, “success”=>true, “errors”=>, “messages”=>}
But the page remains cached. The only way I can get it to expire is doing a full cache purge using the dashboard interface.
Questions
- What is wrong with the above code that the cache isn’t expiring?
- Do you support querystring params as a part of the full cache URL?
- What is the limit to URLs I can include in the purge_cache files array? Sometimes we’ll have to expire thousands so I realize I will need to page through them, just need to know the limit.