summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-07-06 20:46:47 -0500
committerDan McGee <dan@archlinux.org>2010-07-06 20:52:21 -0500
commit65e37349d3ce19b6856e82c75a5b323da8ec40ea (patch)
tree95435df23bb33c8ea73eb966ad6827eddcc04635 /templates
parent907a3168836eede87fe08fea5e67fb7e3b71ce93 (diff)
Enable template fragment caching on main pagerelease_2010-07-06
The left and right sidebars are the same for everyone, so cache both pieces as template fragments so we aren't constantly re-rendering them. Due to cookies being present in the 'Vary:' header, this at least allows some benefit of caching at a lower level than the middleware can handle. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates')
-rw-r--r--templates/public/index.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/public/index.html b/templates/public/index.html
index 19b43c66..d1b1dc2e 100644
--- a/templates/public/index.html
+++ b/templates/public/index.html
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load markup %}
+{% load cache %}
{% block head %}
<link rel="alternate" type="application/rss+xml" title="Arch Linux News Updates" href="/feeds/news/" />
@@ -7,6 +8,7 @@
{% endblock %}
{% block content_left %}
+{% cache 300 main-page-left %}
<div id="intro" class="box">
<h2>A simple, lightweight distribution</h2>
@@ -49,9 +51,11 @@
{% endfor %}
</div><!-- #news -->
+{% endcache %}
{% endblock %}
{% block content_right %}
+{% cache 300 main-page-right %}
<div id="pkgsearch" class="widget">
<form id="pkgsearch-form" method="get" action="/packages/">
@@ -196,4 +200,5 @@
<a href="http://www.airvm.com/VirtualServers" title="AirVM.com - Your Green Technology Partner"><img src="/media/airvm_button.jpg" title="AirVM.com - Your Green Technology Partner" alt="AirVM.com - Your Green Technology Partner" /></a>
</div>
+{% endcache %}
{% endblock %}