Django-compressor serves old version of CSS file eventhough newer version is available

I am hosting my Django application on a DigitalOcean droplet (Ubuntu 22.10 with Gnuicorn and Nginx. When I run my app locally everything looks fine, but as soon as I deploy, it is trying to load the initial version of the compressed CSS file. The newer file lies correctly on the server.

Key files:

Settings.py

BASE_DIR = Path(__file__).resolve().parent.parent
STATIC_ROOT = os.path.join(BASE_DIR,"static")
STATIC_URL = '/static/'
MEDIA_ROOT =  os.path.join(BASE_DIR, "media")
MEDIA_URL = '/media/'
DEBUG = False

urls.py

urlpatterns = [
...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

_base.html

<head>
{% compress css %}
<link rel="stylesheet" href="{% static 'src/output.css' %}">
{% endcompress %}
...
</head>

Other static files and media files work fine, but if you open the website, Django serves an old version of the compressed output.css file.

see the live example here: https://gymtime.ch/

the template is trying to load https://gymtime.ch/static/CACHE/css/output.41dd2db47b39.css (404, does not exist anymore)

but the correct file that is used locally is on the server too: https://gymtime.ch/static/CACHE/css/output.e8979ce60e01.css

How can I ensure the template serves the current compressed CSS file?

Thanks for your support!

Back to Top