Opened 7 years ago

Closed 7 years ago

Last modified 7 months ago

#10066 closed Uncategorized (invalid)

can per-site cache and per-view cache or some low level cache work together?

Reported by: ubestim Owned by: nobody
Component: Documentation Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

can per-site cache and per-view cache or some low level cache work together?
my purpose is to cache the whole site for anonymous and cache serveral
view for registered user only.

first, i set these in per-site cache in settings.py:
CACHE_BACKEND = 'memcached://100.13.192.7:11211/'
CACHE_MIDDLEWARE_SECONDS = 600
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

this means only cache for anonymous.

then i set some per-view cache as below:
@cache_page(60 * 15)
def slashdot_this(request):

so view of slashdot_this will cache for register user and anonymous.

am i right?

If I have added the middleware needed for per-site cache,the cache middleware will cache again the data already cached
by my view?
Can you give more explanation in cache settings for using one of per-persite and per-view/low level and using them together?

Change History (2)

comment:1 Changed 7 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Please ask questions like this on the django-users mailing list or in the #django IRC channel. This Trac install is only for bug reports. Thanks.

comment:2 Changed 7 months ago by int-ua

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset

I've tried to suggest ways to solve this in https://code.djangoproject.com/ticket/25782#ticket

Note: See TracTickets for help on using tickets.
Back to Top