Add cache around navbar and footer
Intentionally outside the tag as generating the context does queries
This commit is contained in:
parent
0e20ad3269
commit
7ed5255b69
1 changed files with 7 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri %}
|
||||
{% load static wagtailcore_tags wagtailuserbar navbar_tags footer_tags plausible_wagtail favicon_tags sri cache %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-GB">
|
||||
|
@ -30,7 +30,9 @@
|
|||
<body class="{% block body_class %}{% endblock %}">
|
||||
{% wagtailuserbar %}
|
||||
|
||||
{% cache 1800 "navbar" request.is_preview %}
|
||||
{% navbar %}
|
||||
{% endcache %}
|
||||
|
||||
{% block main %}
|
||||
<main>
|
||||
|
@ -38,7 +40,9 @@
|
|||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% cache 1800 "footer" request.is_preview %}
|
||||
{% footer %}
|
||||
{% endcache %}
|
||||
|
||||
<script async defer type="text/javascript" src="{% static 'js/base.js' %}" integrity="{% sri_integrity_static 'js/base.js' %}"></script>
|
||||
<script async defer type="text/javascript" src="{% static 'contrib/htmx/htmx.min.js' %}" integrity="{% sri_integrity_static 'contrib/htmx/htmx.min.js' %}"></script>
|
||||
|
|
Loading…
Reference in a new issue