From f2f35e8fc6597fa1d382df7979b67ace5e51b703 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 31 Aug 2024 11:08:15 +0200 Subject: [PATCH] =?UTF-8?q?cache=20diff=C3=A9renci=C3=A9=20suivant=20conne?= =?UTF-8?q?ct=C3=A9/non=20connect=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #117 --- src/agenda_culturel/templates/agenda_culturel/page-day.html | 4 +++- .../templates/agenda_culturel/page-month.html | 4 +++- .../templates/agenda_culturel/page-week.html | 6 ++++-- .../templates/agenda_culturel/place_detail.html | 4 +++- .../templates/agenda_culturel/place_list.html | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/agenda_culturel/templates/agenda_culturel/page-day.html b/src/agenda_culturel/templates/agenda_culturel/page-day.html index 75447d9..1f91458 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-day.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-day.html @@ -24,7 +24,8 @@ {% block content %} {% get_current_language as LANGUAGE_CODE %} - {% cache 500 day user.is_authenticated day filter.to_str LANGUAGE_CODE %} + {% with cache_timeout=user.is_authenticated|yesno:"30,600" %} + {% cache cache_timeout day user.is_authenticated day filter.to_str LANGUAGE_CODE %} {% include "agenda_culturel/filter-inc.html" with filter=filter %} @@ -105,5 +106,6 @@ {% endcache %} +{% endwith %} {% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/page-month.html b/src/agenda_culturel/templates/agenda_culturel/page-month.html index 082b2a1..dc5241c 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-month.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-month.html @@ -24,7 +24,8 @@ {% block content %} {% get_current_language as LANGUAGE_CODE %} - {% cache 500 month user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %} + {% with cache_timeout=user.is_authenticated|yesno:"30,600" %} + {% cache cache_timeout month user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %} {% include "agenda_culturel/filter-inc.html" with filter=filter %} @@ -71,6 +72,7 @@ {% endcache %} +{% endwith %} {% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/page-week.html b/src/agenda_culturel/templates/agenda_culturel/page-week.html index 0c3cde1..b4e4ed5 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-week.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-week.html @@ -21,7 +21,8 @@ {% block content %} {% get_current_language as LANGUAGE_CODE %} - {% cache 500 week user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %} + {% with cache_timeout=user.is_authenticated|yesno:"30,600" %} + {% cache cache_timeout week user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %} {% include "agenda_culturel/filter-inc.html" with filter=filter %} @@ -67,5 +68,6 @@ {% endcache %} - +{% endwith %} + {% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/place_detail.html b/src/agenda_culturel/templates/agenda_culturel/place_detail.html index 1902a68..ada783e 100644 --- a/src/agenda_culturel/templates/agenda_culturel/place_detail.html +++ b/src/agenda_culturel/templates/agenda_culturel/place_detail.html @@ -64,7 +64,8 @@ {% get_current_language as LANGUAGE_CODE %} - {% cache 500 place_list user.is_authenticated object %} + {% with cache_timeout=user.is_authenticated|yesno:"30,600" %} + {% cache cache_timeout place_list user.is_authenticated object %} {% if object_list %}

Événements du lieu

@@ -81,6 +82,7 @@ {% endif %} {% endcache %} + {% endwith %}