Automatically purge cache on modification of ContentSource #4587
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: api
Related to the Django API
Problem
When a ContentSource is modified in the Django admin, the changes may not be visible in the frontend immediately due to caching. For instance if a ContentSource is updated to
Hide content
, the hidden source may still appear in the frontend if it's getting the cached response for the stats endpoint. This is problematic because we'd like hiding/un-hiding sources to have immediate effect.Description
We should purge the Cloudflare cache for the stats endpoint whenever ContentSource is modified. We can do this with the Cloudflare API for purging cached content by URL as described here. Note that we should make sure to purge by exact URL match rather than prefix, as only the former is free.
The text was updated successfully, but these errors were encountered: