From 0a02421dd593f0466226b9defc33337cdbf672ef Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Wed, 11 Jul 2018 13:24:36 +0200 Subject: [PATCH 1/1] rework book box caching --- src/catalogue/templates/catalogue/book_detail.html | 5 +---- src/catalogue/templates/catalogue/book_short.html | 6 ++++++ src/catalogue/templates/catalogue/book_text.html | 5 +---- src/catalogue/templates/catalogue/work-list.html | 6 +----- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/catalogue/templates/catalogue/book_detail.html b/src/catalogue/templates/catalogue/book_detail.html index cf26b125a..865aca2bb 100644 --- a/src/catalogue/templates/catalogue/book_detail.html +++ b/src/catalogue/templates/catalogue/book_detail.html @@ -13,10 +13,7 @@ {% block bodyid %}book-detail{% endblock %} {% block body %} - {% get_current_language as LANGUAGE_CODE %} - {% cache 86400 book_wide book.pk book|status:user LANGUAGE_CODE %} - {% include 'catalogue/book_wide.html' %} - {% endcache %} + {% include 'catalogue/book_wide.html' %} {% work_list book_children %} diff --git a/src/catalogue/templates/catalogue/book_short.html b/src/catalogue/templates/catalogue/book_short.html index fff3fc0ff..4f186e8ff 100644 --- a/src/catalogue/templates/catalogue/book_short.html +++ b/src/catalogue/templates/catalogue/book_short.html @@ -1,5 +1,6 @@ {% spaceless %} {% load i18n %} + {% load cache %} {% load catalogue_tags %} {% load book_shelf_tags from social_tags %} {% load static %} @@ -28,6 +29,8 @@ {% block cover-area-extra %}{% endblock %} + {% get_current_language as LANGUAGE_CODE %} + {% cache 86400 book_box_head_tags book.pk LANGUAGE_CODE %}
{% for tag in tags.author %} @@ -94,9 +97,11 @@ {% endif %} {% endwith %}
+ {% endcache %}
{% book_shelf_tags book.pk %} + {% cache 86400 book_box_tools book.pk book|status:request.user LANGUAGE_CODE %} {% if book|status:request.user != 'closed' %}