dimagi / quickcache

caching has never been easier
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Using a Django Request Cache in place of Memoized Cache. #12

Open robrap opened 6 years ago

robrap commented 6 years ago

Hello.

I was implementing my own version of a TieredCache in Django when a colleague pointed me to this caching solution. I like it, but the local cache I want is a Request Cache, rather than the Timed Memoized Cache. I also heard you may already have a Request Cache version available?

Thank you.

Robert

dannyroberts commented 6 years ago

There are currently two ways that you achieve the effect of request-scoping all in-memory caching:

It occurs to me that I have not documented that get_django_quickcache uses your Django caches named 'default' (for shared cache) and 'locmem' (for in-memory cache), and that these should be something you can specify when calling get_django_quickcache. I've opened an issue about this https://github.com/dimagi/quickcache/issues/13

robrap commented 6 years ago

Thanks for your response Danny. I'll let you know if I have any questions, but hopefully this should cover it.