Add caching
This commit is contained in:
parent
87c232d3f9
commit
40a710f41e
|
@ -45,6 +45,20 @@ INSTALLED_APPS = [
|
||||||
"prettyjson",
|
"prettyjson",
|
||||||
"mixins",
|
"mixins",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Performance optimisations
|
||||||
|
CACHES = {
|
||||||
|
"default": {
|
||||||
|
"BACKEND": "django.core.cache.backends.redis.RedisCache",
|
||||||
|
"LOCATION": "unix:///var/run/socks/redis.sock",
|
||||||
|
"OPTIONS": {
|
||||||
|
"db": "10",
|
||||||
|
"parser_class": "redis.connection.PythonParser",
|
||||||
|
"pool_class": "redis.BlockingConnectionPool",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CRISPY_TEMPLATE_PACK = "bulma"
|
CRISPY_TEMPLATE_PACK = "bulma"
|
||||||
CRISPY_ALLOWED_TEMPLATE_PACKS = ("bulma",)
|
CRISPY_ALLOWED_TEMPLATE_PACKS = ("bulma",)
|
||||||
DJANGO_TABLES2_TEMPLATE = "django-tables2/bulma.html"
|
DJANGO_TABLES2_TEMPLATE = "django-tables2/bulma.html"
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load has_plan %}
|
{% load has_plan %}
|
||||||
|
{% load cache %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en-GB">
|
<html lang="en-GB">
|
||||||
|
{% cache 600 head %}
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
@ -235,8 +237,9 @@
|
||||||
<!-- End Piwik Code -->
|
<!-- End Piwik Code -->
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
{% endcache %}
|
||||||
<body>
|
<body>
|
||||||
|
{% cache 600 nav request.user.id %}
|
||||||
<nav class="navbar" role="navigation" aria-label="main navigation">
|
<nav class="navbar" role="navigation" aria-label="main navigation">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<a class="navbar-item" href="{% url 'home' %}">
|
<a class="navbar-item" href="{% url 'home' %}">
|
||||||
|
@ -334,6 +337,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
{% endcache %}
|
||||||
<script>
|
<script>
|
||||||
let deferredPrompt;
|
let deferredPrompt;
|
||||||
const addBtn = document.querySelector('.add-button');
|
const addBtn = document.querySelector('.add-button');
|
||||||
|
|
|
@ -22,3 +22,6 @@ msgpack
|
||||||
apscheduler
|
apscheduler
|
||||||
django-prettyjson
|
django-prettyjson
|
||||||
git+https://git.zm.is/XF/django-crud-mixins
|
git+https://git.zm.is/XF/django-crud-mixins
|
||||||
|
# For caching
|
||||||
|
redis
|
||||||
|
hiredis
|
||||||
|
|
Loading…
Reference in New Issue