Cache sass for an hour

This commit is contained in:
George Lacey 2021-05-18 17:00:56 +01:00
parent 0dc022b861
commit 430808d7fa
2 changed files with 3 additions and 2 deletions

View File

@ -6,11 +6,14 @@
{% block script %}
{% load static %}
{% load cache %}
{% cache 3600 sass %}
<link rel="shortcut icon" href="{% static 'favicon.ico' %}">
{% load compress %}
{% compress css %}
<link type="text/x-scss" href="{% static 'theme.scss' %}" rel="stylesheet" media="screen">
{% endcompress %}
{% endcache %}
{% endblock %}
<style>{% block style %}{% endblock %}</style>

View File

@ -7,10 +7,8 @@ from .forms import RepoForm, ArchiveForm, ErrorForm, LocationForm
from django.contrib.auth.decorators import permission_required
from .utility import data
from datetime import datetime, timedelta
from django.views.decorators.cache import cache_page
@cache_page(60)
def index(request):
repo_list = Repo.objects.all()
location_list = Location.objects.all()