summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-07 18:31:55 +0200
committerDan McGee <dan@archlinux.org>2011-10-07 18:31:55 +0200
commita01a11cfad84bd44c1f5aeffcc0665bd93889e1d (patch)
tree29abd73f5767cd6667a2dfa9e2edd37fbdd12014
parentf6527810b0d28db8a07a26e84148d1229b18d29e (diff)
downloadarchweb-a01a11cfad84bd44c1f5aeffcc0665bd93889e1d.tar.gz
archweb-a01a11cfad84bd44c1f5aeffcc0665bd93889e1d.tar.xz
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>
-rw-r--r--urls.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/urls.py b/urls.py
index cdae51b..edd51b5 100644
--- a/urls.py
+++ b/urls.py
@@ -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)),