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:

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

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


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

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:

the template is trying to load (404, does not exist anymore)

but the correct file that is used locally is on the server too:

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

Thanks for your support!

Back to Top