Merge pull request #1394 from bookwyrm-social/cache-busting

Adds javascript cache value to templates
This commit is contained in:
Mouse Reeve 2021-09-10 11:07:09 -07:00 committed by GitHub
commit 7dc1ef390e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 6 deletions

View file

@ -15,4 +15,5 @@ def site_settings(request): # pylint: disable=unused-argument
"media_full_url": settings.MEDIA_FULL_URL,
"preview_images_enabled": settings.ENABLE_PREVIEW_IMAGES,
"request_protocol": request_protocol,
"js_cache": settings.JS_CACHE,
}

View file

@ -13,6 +13,8 @@ VERSION = "0.0.1"
PAGE_LENGTH = env("PAGE_LENGTH", 15)
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
JS_CACHE = "19447742"
# email
EMAIL_BACKEND = env("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend")
EMAIL_HOST = env("EMAIL_HOST")

View file

@ -325,5 +325,5 @@
{% endblock %}
{% block scripts %}
<script src="{% static "js/vendor/tabs.js" %}"></script>
<script src="{% static "js/vendor/tabs.js" %}?v={{ js_cache }}"></script>
{% endblock %}

View file

@ -106,5 +106,5 @@
{% endblock %}
{% block scripts %}
<script src="{% static "js/vendor/tabs.js" %}"></script>
<script src="{% static "js/vendor/tabs.js" %}?v={{ js_cache }}"></script>
{% endblock %}

View file

@ -156,5 +156,5 @@
{% endspaceless %}{% endblock %}
{% block scripts %}
<script src="{% static "js/check_all.js" %}"></script>
<script src="{% static "js/check_all.js" %}?v={{ js_cache }}"></script>
{% endblock %}

View file

@ -255,9 +255,9 @@
var csrf_token = '{{ csrf_token }}';
</script>
<script src="{% static "js/bookwyrm.js" %}"></script>
<script src="{% static "js/localstorage.js" %}"></script>
<script src="{% static "js/status_cache.js" %}"></script>
<script src="{% static "js/bookwyrm.js" %}?v={{ js_cache }}"></script>
<script src="{% static "js/localstorage.js" %}?v={{ js_cache }}"></script>
<script src="{% static "js/status_cache.js" %}?v={{ js_cache }}"></script>
{% block scripts %}{% endblock %}
</body>