On Thu, Jun 5, 2008 at 3:05 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I've read the caching documentation several times, but must be missing > some fine points. If I have > CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True > set, does per-view or template fragment caching override that?
If you have CacheMiddleware enabled, and you have CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True in your settings file, then: * Assuming you don't use any other caching mechanisms of any sort, caching only occurs for anonymous users. * If you apply the cache_page decorator to a specific view, the caching performed by that decorator only occurs for anonymous users. * If you use the {% cache %} tag in a template, the caching occurs for all users in all situations regardless of anonymous status. * If you use the low-level cache.get()/cache.set() API, the caching occurs for all users in all situations regardless of anonymous status. Basically, this means that when you single out a small fragment of template or Python code and use the fine-grained caching mechanisms, Django assumes you've got a good reason for doing so and know better than it does that you want to cache. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---