Can we solve this problem ?
https://stackoverflow.com/questions/51239469/cache-invalidation-is-not-working-in-browser-using-or-app-rest-api
On Thursday, August 18, 2016 at 1:04:33 AM UTC+5:30, Fred Stluka wrote:
>
> Django users,
>
> Is there an easy way to enable an automatic write-through 
> database cache in Django?
>
> I'd want memcached or something to cache all data read by the 
> Django ORM and use the cached copy on future reads, and of 
> course update the cache as well as the DB (a "write-through" 
> cache) when writing data.
>
> Is there a piece of middleware I can activate to cause the ORM
> to do this automatically for all DB queries?  Thanks!
>
> Details:
>
> I'm interested in caching the results of queries to the DB, not 
> caching the results of templates or views.  So, it is different 
> from the following, which I already know how to do:
> - Caching of template files:
>    - 
> http://us5.campaign-archive1.com/?u=a8d4be66d1927077a9255182d&id=a6f7d644a7&e=c90970e145
>    - 
> https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.cached.Loader
> - Caching of all Django views for an entire site:
>    - 
> https://docs.djangoproject.com/en/dev/topics/cache/#the-per-site-cache
> - Caching of specific Django views:
>   - https://docs.djangoproject.com/en/dev/topics/cache/#the-per-view-cache
> - Caching of fragments of a Django Template:
>   - 
> https://docs.djangoproject.com/en/dev/topics/cache/#template-fragment-caching
>
> I'm also hoping to not have to add cache API calls throughout my
> code, as described here:
> - 
> https://docs.djangoproject.com/en/dev/topics/cache/#the-low-level-cache-api
>
> I'd like the Django ORM to make the API calls for me automatically
> when I call objects.get(), objects.filter(), save(), etc.  I'd hoped to 
> enable it simply by adding middleware or a custom manager or 
> something.
>
> Any suggestions?  I feel like I may be missing something obvious.
>
> --Fred 
> ------------------------------
> Fred Stluka -- [email protected] <javascript:> -- 
> http://bristle.com/~fred/ 
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service! 
> Open Source: Without walls and fences, we need no Windows or Gates. 
> ------------------------------
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67053999-1707-49e9-839e-d8faf4759351%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to