V
V
Vladimir Kuts2017-03-11 10:36:11
Django
Vladimir Kuts, 2017-03-11 10:36:11

Cache invalidation for a specific class?

I have a profile page where the user changes his mail, name, and so on.
The page is rendered using a TemplateView.
Redis-based caching is also enabled for the site.
Now the problem is:
The user visits the page. Changes, - let's say your email, the request is processed, an inscription is displayed about the successful change of data. Everything seems to be fine.
But then the user decides to refresh the page, and sees the old data. The data was cached.
How do I perform cache invalidation for a single page generated from Common Based Views?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maxclax, 2017-03-13
@maxclax

What prevents when updating the model or, for example, after form_valid, resetting the cache by key for this user?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question