cache différencié suivant connecté/non connecté

Fix #117
This commit is contained in:
Jean-Marie Favreau 2024-08-31 11:08:15 +02:00
parent a515d26475
commit f2f35e8fc6
5 changed files with 16 additions and 6 deletions

View File

@ -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 @@
</div>
{% endcache %}
{% endwith %}
{% endblock %}

View File

@ -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 @@
</footer>
</article>
{% endcache %}
{% endwith %}
{% endblock %}

View File

@ -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 @@
</footer>
</article>
{% endcache %}
{% endwith %}
{% endblock %}

View File

@ -64,7 +64,8 @@
</div>
</div>
{% 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 %}
<h2>Événements du lieu</h2>
@ -81,6 +82,7 @@
{% endif %}
{% endcache %}
{% endwith %}
<footer>
<!--p>Voir tous les événements de ce lieu</p-->
{% if user.is_authenticated %}

View File

@ -34,7 +34,8 @@
<div class="vertical-max">
{% get_current_language as LANGUAGE_CODE %}
{% cache 500 place_lists user.is_authenticated %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout place_lists user.is_authenticated %}
{% if object_list %}
{% for place in object_list %}
@ -53,6 +54,7 @@
<p>Il n'y a aucun lieu défini.</p>
{% endif %}
{% endcache %}
{% endwith %}
</div>
</div>
</article>