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

How cache is invalidated #9

Open
iairsalem opened this issue Jul 5, 2021 · 0 comments
Open

How cache is invalidated #9

iairsalem opened this issue Jul 5, 2021 · 0 comments

Comments

@iairsalem
Copy link

iairsalem commented Jul 5, 2021

As opposed to dogpile.cache, where there are examples of invalidating the cache for particular queries, how is Cache invalidated on this project?

  1. Is it done automatically? EDIT: (I saw there's an invalidate method, but when is it invoked?)

  2. If so, should I be worried about using raw sql (bulk inserts, bulk updates)? how to handle those cases?

EDIT:
3a) is the query caching useful from request to request? it seems that the namespace is created per query. namespace contains a random number...

3b) What's the ideal scenario for the cache? How can I manually ensure I keep the cache live for the most time possible while also making sure that's invalidated when the data is not up-to-date (assuming my app is the only one that modifies the Database.

Thanks in advance.

EDIT 2:

  1. doing db.session.commit() will make an allegedly "cached" query to be called again. Even though the commit was for a totally different entity than the one involved in the cached query. Am I missing something? Can't I just get a cache and invalidate it manually?
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