[Answer]-Advice needed on Django caching strategy

1👍

If I get your question correctly, your async job must invalidate the relevant cache key when new data is fetched.

In your template you have this:

{% cache 6000 some-page-identifier %}

In your async task you invalidate data like this:

def fetch_data():
    # Fetch data first
    # Then invalidate the cached item
    cache.delete('some-page-identifier')
👤shanyu

Leave a comment