diff options
author | Dan McGee <dan@archlinux.org> | 2011-10-07 11:31:55 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-10-07 11:31:55 -0500 |
commit | a01a11cfad84bd44c1f5aeffcc0665bd93889e1d (patch) | |
tree | 29abd73f5767cd6667a2dfa9e2edd37fbdd12014 /urls.py | |
parent | f6527810b0d28db8a07a26e84148d1229b18d29e (diff) |
Cache static /jsi18n/ resource for one week
Rather than the default middleware page cache length of only minutes.
This will save clients a lot of requests when browsing packages.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'urls.py')
-rw-r--r-- | urls.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -5,6 +5,8 @@ from django.conf import settings from django.contrib import admin from django.views.generic import TemplateView +from django.views.decorators.cache import cache_page +from django.views.i18n import null_javascript_catalog from feeds import PackageFeed, NewsFeed import sitemaps @@ -65,7 +67,8 @@ urlpatterns += patterns('public.views', # Includes and other remaining stuff urlpatterns += patterns('', - (r'^jsi18n/$', 'django.views.i18n.null_javascript_catalog'), + # cache this static JS resource for 1 week rather than default 5 minutes + (r'^jsi18n/$', cache_page(604800)(null_javascript_catalog)), (r'^admin/', include(admin.site.urls)), (r'^devel/', include('devel.urls')), (r'^feeds/', include(feeds_patterns)), |