diff --git a/app/settings.py b/app/settings.py index d8dd5db..e73677f 100644 --- a/app/settings.py +++ b/app/settings.py @@ -67,7 +67,9 @@ MIDDLEWARE = [ "debug_toolbar.middleware.DebugToolbarMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", + # 'django.middleware.cache.UpdateCacheMiddleware', "django.middleware.common.CommonMiddleware", + # 'django.middleware.cache.FetchFromCacheMiddleware', "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", diff --git a/core/templates/partials/product-list.html b/core/templates/partials/product-list.html index 9d845b3..89c2d26 100644 --- a/core/templates/partials/product-list.html +++ b/core/templates/partials/product-list.html @@ -1,48 +1,47 @@ {% load static %} +{% load cache %} -{% for plan in plans %} - - -
-
-
-
- Image -
-
-
-
-

- {{ plan.name }} £{{ plan.cost }} - {% if plan in user_plans %} - - {% endif %} -
- {{ plan.description }} -

+{% cache 600 objects_plans request.user.id plans %} + {% for plan in plans %} +
+
+
+
+ Image +
- -
-
-
-{% endfor %} - + + + + + {% endfor %} +{% endcache %} \ No newline at end of file diff --git a/core/templates/partials/rule-list.html b/core/templates/partials/rule-list.html index 7fa3e08..89f8561 100644 --- a/core/templates/partials/rule-list.html +++ b/core/templates/partials/rule-list.html @@ -1,93 +1,95 @@ +{% load cache %} {% include 'mixins/partials/notify.html' %} - - - - - - - - - - - - - - - - {% for item in object_list %} - - - - - - - - - - - -
idusernameintervalwindowprioritytopicenableddata lengthmatchactions
{{ item.id }}{{ item.user }}{{ item.name }}{{ item.interval }}s{{ item.window|default_if_none:"—" }}{{ item.priority }}{{ item.topic|default_if_none:"—" }} - {% if item.enabled %} - - - - {% else %} - - - - {% endif %} - {{ item.data|length }}{{ item.matches }} -
-
+{% endcache %} \ No newline at end of file