Questions tagged [django-caching]

django-caching refers to the Django cache system

django-caching refers to the Django cache system.

Quote from docs:

Django comes with a robust cache system that lets you save dynamic pages so they don’t have to be calculated for each request. For convenience, Django offers different levels of cache granularity: You can cache the output of specific views, you can cache only the pieces that are difficult to produce, or you can cache your entire site.

57 questions
0
votes
1 answer

how can i invalidate page cache in django

How can I invalidate page cache in django. I am trying to cache a page displays a list that is unique for each user using django-rest-framework. I can not figure out how to invalidate the page cache when the another object is added, updated, deleted…
user14665310
  • 524
  • 4
  • 13
0
votes
1 answer

Model based caching instead of view based caching in django

I am working on a django application. The main task of the application is providing suggestion like "Should I go outside today?". There is only a single endpoint to get the suggestion such as example.com/. The main logic for providing the suggestion…
0
votes
1 answer

Django - Disable Page Level Caching by User

I've set up page level caching for many of our pages. However once in a while an admin user logs in to preview potential changes to the site. Is there a way to disable page level caching just for these users? I read through the docs but I didn't…
Greg
  • 45,306
  • 89
  • 231
  • 297
0
votes
1 answer

Check User online Django 1.10

Hi trying to do like in example: How to check whether a user is online in django template? but when adding 'userprofile.middleware.ActiveUserMiddleware', to MIDDLEWARE_CLASSES recieving next error: Unhandled exception in thread started by…
Hellbea
  • 289
  • 6
  • 14
0
votes
1 answer

Why is the Django database cache not shared across multiple threads?

It seems each thread maintains its separate cache. Should I just use my own Django object to have a Database cache shared by multiple threads? What are the negatives to doing this? The problem I am facing is this: I am using the database cache I…
sureshvv
  • 4,234
  • 1
  • 26
  • 32
0
votes
0 answers

Does Filesystem caching system of Django stores the cache on server or the user system?

I read the documentation as well but could not get clearing on this. Also, do we need to install anything extra for this to work? I have added below code in settings.py file : CACHES = { 'default': { 'BACKEND':…
sid8491
  • 6,622
  • 6
  • 38
  • 64
0
votes
1 answer

erase template cache

I have a Django app where users can select between 2 interface modes, that mode affect some pages... for those pages I use different templates In urls.py I have something like this: mode = Config.objects.get().mode urlpatterns = patterns('', …
juanefren
  • 2,818
  • 6
  • 32
  • 41
0
votes
1 answer

Can not iterate over results of a cached queryset in Django

I'd like to cache only the comments section of each article without caching the whole page, so the article views, I have try: cmnts_key = post_slug comments = cache.get(cmnts_key) if not comments: comments =…
Jand
  • 2,527
  • 12
  • 36
  • 66
0
votes
1 answer

What lightweight django caching options are there, for a simple inner loop, in a single session?

I have something that looks like this: pages = Page.objects.prefetch_related("sections","sections__tiles").all() for page in pages: for section in page.sections.all(): for tile in section.tiles.all(): print tile.author …
Bryce
  • 8,313
  • 6
  • 55
  • 73
0
votes
1 answer

At what point does a cache key get correctly generated

In the according to the docs it effectively says that you should use a KEY_PREFIX when sharing a cache instance between servers. My question is when does is at what point does the KEY_PREFIX apply? Using MemcachedStats here is basic example from…
rh0dium
  • 6,811
  • 4
  • 46
  • 79
0
votes
1 answer

Django + memcached: generate cached pages automatically?

I am using Django + memcached and have a (hopefully) simple question. My database is updated once a day. My pages are set to time out after 24 hours. Is there a way to generate all the pages of the site into the cache once each day, just after the…
Richard
  • 62,943
  • 126
  • 334
  • 542
-2
votes
1 answer

What kind of Django has caches

For example, there are caches like hazelcast. So in django cache types which have ? Whichever is most preferably ?
1 2 3
4