Add CacheStore, a store that uses Django's cache framework#2304
Add CacheStore, a store that uses Django's cache framework#2304robhudson wants to merge 10 commits intodjango-commons:mainfrom
CacheStore, a store that uses Django's cache framework#2304Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
tim-schilling
left a comment
There was a problem hiding this comment.
Thank you for adding this. We'll need to add some documentation around this as well. I suspect you're just looking for feedback on the approach right now though. I have a few questions.
For me, I think I would have gone with a ContextVar to control the tracking of the cache panel similar to allow_sql, but this should be fine.
|
Another thought, I wonder if we can run the full test suite using |
|
Thanks for the review! A couple notes:
I'll look into your other comments today. Good stuff. |
|
An interesting discovery: The Is this acceptable behavior, or should we also prevent these SQL queries from being tracked? It should be possible to dynamically add the
|
f9572df to
c90b3ac
Compare
It seems like we should have the ability to disable all tracking from within the toolbar temporarily, but ideally also allow the user to view those events. I suspect this means we need to shift away from However, reducing our scope to just this change, I think ideally we'd prevent these SQL queries from being tracked. If it's not going to result in something horrible, I think we should do that. |
|
I refactored the tests a bit to test the various cache backends and added support for not tracking the self-generated SQL from the cache store using a database. |
Summary
CacheStorethat uses Django's cache framework to persist toolbar dataCACHE_BACKENDandCACHE_KEY_PREFIXsettings to configure which cache and key prefix to use_UntrackedCacheproxyMotivation
By using Django's cache framework, users can choose any configured cache backend for toolbar storage. The interesting thing about this is that the
LocMemCachebackend can effectively act like theMemoryStore, and theDatabaseCachebackend can effectively act like theDatabaseStore.Notes
FileBasedCache)Checklist:
docs/changes.rst.AI/LLM Usage