Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is my cache not invalidated? #236

Open
creyD opened this issue May 25, 2023 · 1 comment
Open

Why is my cache not invalidated? #236

creyD opened this issue May 25, 2023 · 1 comment

Comments

@creyD
Copy link
Contributor

creyD commented May 25, 2023

What happened?

My project uses Django version 4.1.9 and cachalot 2.5.3 (latest version). I just added the CACHES (BACKEND: "django.core.cache.backends.redis.RedisCache") option in Django and added the UpdateCacheMiddleware and FetchFromCacheMiddleware middlewares plus added "cachalot" to my installed_apps. Now when I patch/ put anything I am getting a correct and updated response (200 with the changes) but when I try to GET the resource it still shows the old response (200 without the changes).

What should've happened instead?

Django cachalot should have invalidated the cache.

@creyD
Copy link
Contributor Author

creyD commented May 25, 2023

I suppose this is because Django per-site caches are not to use with django cachalot. I suspect that the site is cached and even though cachalot invalidates the SQL cache the stale site still gets delivered, as Django doesn't even run a new SQL query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant