From 51c932802abb6cf7d47918767c41cf8be3444841 Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Mon, 26 Dec 2022 17:50:51 +0100 Subject: [PATCH 1/3] Use language in cachey key for about_page_superlatives --- bookwyrm/templates/about/about.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/about/about.html b/bookwyrm/templates/about/about.html index c446e0cf2..6705793d5 100644 --- a/bookwyrm/templates/about/about.html +++ b/bookwyrm/templates/about/about.html @@ -10,8 +10,9 @@ {% endblock %} {% block about_content %} +{% get_current_language as LANGUAGE_CODE %} {# seven day cache #} -{% cache 604800 about_page_superlatives %} +{% cache 604800 about_page_superlatives LANGUAGE_CODE %} {% get_book_superlatives as superlatives %}
From 9aad37acd5c5b128bf4fc7222a755f820cf1bf3a Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Mon, 26 Dec 2022 17:52:03 +0100 Subject: [PATCH 2/3] Specificy fragment name in cache key for landing page --- bookwyrm/templates/landing/landing.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/landing/landing.html b/bookwyrm/templates/landing/landing.html index e4807b005..465584cab 100644 --- a/bookwyrm/templates/landing/landing.html +++ b/bookwyrm/templates/landing/landing.html @@ -10,7 +10,8 @@ {% get_current_language as LANGUAGE_CODE %} -{% cache 60 * 60 LANGUAGE_CODE %} +{# 1 hour cache #} +{% cache 3600 landing LANGUAGE_CODE %} {% get_landing_books as books %}
From 247d85305cdebd5a0106de6c13dca691067842f1 Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Mon, 26 Dec 2022 17:52:58 +0100 Subject: [PATCH 3/3] Fix cache duration comment --- bookwyrm/templates/snippets/book_titleby.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/templates/snippets/book_titleby.html b/bookwyrm/templates/snippets/book_titleby.html index 3182dc996..dc42bf273 100644 --- a/bookwyrm/templates/snippets/book_titleby.html +++ b/bookwyrm/templates/snippets/book_titleby.html @@ -4,7 +4,7 @@ {% spaceless %} {% get_current_language as LANGUAGE_CODE %} -{# 6 month cache #} +{# 10 second cache #} {% cache 10 titleby LANGUAGE_CODE book.id %} {% if book.authors.exists %}