Cache more object lists
This commit is contained in:
parent
40a710f41e
commit
5d6f96bbf3
|
@ -67,7 +67,9 @@ MIDDLEWARE = [
|
||||||
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
||||||
"django.middleware.security.SecurityMiddleware",
|
"django.middleware.security.SecurityMiddleware",
|
||||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||||
|
# 'django.middleware.cache.UpdateCacheMiddleware',
|
||||||
"django.middleware.common.CommonMiddleware",
|
"django.middleware.common.CommonMiddleware",
|
||||||
|
# 'django.middleware.cache.FetchFromCacheMiddleware',
|
||||||
"django.middleware.csrf.CsrfViewMiddleware",
|
"django.middleware.csrf.CsrfViewMiddleware",
|
||||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||||
"django.contrib.messages.middleware.MessageMiddleware",
|
"django.contrib.messages.middleware.MessageMiddleware",
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load cache %}
|
||||||
|
|
||||||
{% for plan in plans %}
|
{% cache 600 objects_plans request.user.id plans %}
|
||||||
|
{% for plan in plans %}
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<article class="media">
|
<article class="media">
|
||||||
<div class="media-left">
|
<div class="media-left">
|
||||||
|
@ -43,6 +43,5 @@
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endcache %}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
{% load cache %}
|
||||||
{% include 'mixins/partials/notify.html' %}
|
{% include 'mixins/partials/notify.html' %}
|
||||||
|
{% cache 600 objects_rules request.user.id object_list %}
|
||||||
<table
|
<table
|
||||||
class="table is-fullwidth is-hoverable"
|
class="table is-fullwidth is-hoverable"
|
||||||
hx-target="#{{ context_object_name }}-table"
|
hx-target="#{{ context_object_name }}-table"
|
||||||
id="{{ context_object_name }}-table"
|
id="{{ context_object_name }}-table"
|
||||||
|
@ -90,4 +91,5 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
{% endcache %}
|
Loading…
Reference in New Issue