@@ -13,7 +13,9 @@
diff --git a/website/common/templatetags/util_tags.py b/website/common/templatetags/util_tags.py
index bc7e1cd..06e4b82 100644
--- a/website/common/templatetags/util_tags.py
+++ b/website/common/templatetags/util_tags.py
@@ -1,3 +1,5 @@
+import random
+
from django.template import Library
from django.utils.encoding import force_str
from wagtail.models import Page
@@ -18,6 +20,11 @@ def pagefullurl(context: dict, page: Page) -> str:
return page.get_full_url(context["request"])
+@register.filter()
+def jitter(original: float, jitter: float) -> float:
+ return random.uniform(original + jitter, original - jitter)
+
+
@register.filter()
def extract_text(html: str | RichText) -> str:
return utils.extract_text(force_str(html))
{{ page.title }}
{% include "common/content-details.html" %} -{{ page.summary }}
+ {% cache 900|jitter:60 "summary" page.id request.is_preview %} +{{ page.summary }}
+ {% endcache %}