Ticket #9709: django-admin-and-caching-docs.patch
File django-admin-and-caching-docs.patch, 1.9 KB (added by , 16 years ago) |
---|
-
docs/faq/admin.txt
31 31 How can I prevent the cache middleware from caching the admin site? 32 32 ------------------------------------------------------------------- 33 33 34 Set the :setting:`CACHE_MIDDLEWARE_ANONYMOUS_ONLY` setting to ``True``. See the 35 :ref:`cache documentation <topics-cache>` for more information. 34 See :ref:`AdminSite and caching <admin-and-caching>` documentation. 36 35 37 36 How do I automatically set a field's value to the user who last edited the object in the admin? 38 37 ----------------------------------------------------------------------------------------------- -
docs/ref/contrib/admin.txt
1071 1071 ('^basic-admin/(.*)', basic_site.root), 1072 1072 ('^advanced-admin/(.*)', advanced_site.root), 1073 1073 ) 1074 1075 .. _admin-and-caching: 1076 1077 ``AdminSite`` and ``caching`` 1078 ============================= 1079 1080 ``AdminSite`` is a set of pages which you probably do not want to cache at all. There 1081 are two simple ways to exclude them. 1082 1083 If only a small fraction of your traffic is generated by authenticated users, you may just 1084 set the :setting:`CACHE_MIDDLEWARE_ANONYMOUS_ONLY`setting to ``True``. 1085 See the :ref:`cache documentation <topics-cache>` for more information. 1086 1087 Other solution is to tell Django not to cache the whole admin subtree, using decorator at 1088 URLs configuration:: 1089 1090 # urls.py 1091 from django.conf.urls.defaults import * 1092 from django.contrib import admin 1093 from django.views.decorators.cache import never_cache 1094 1095 admin.autodiscover() 1096 1097 urlpatterns = patterns('', 1098 ('^admin/(.*)', never_cache(admin.site.root)), 1099 ) 1100