Closed edevil closed 6 years ago
The reason for not having the correct cache headers is because Whitenoise considers a file immutable when it has the hash in the filename, not the query string. So I really need to make django_assets correctly render the asset URL when the version placeholder is used with a Django manifest.
If I configure the manifest like this in the settings file:
ASSETS_MANIFEST = DjangoManifest()
The templates start to be rendered, however, there's a period added that's wrong:
<link rel="stylesheet" href="/static/gen/packed..f9a66270.css">
<script type="text/javascript" src="/static/gen/packed..84fed0ca.js"></script>
In the manifest they appear fine:
"gen/packed.js": "gen/packed.84fed0ca.js", "gen/packed.css": "gen/packed
.f9a66270.css"
I'm using Django 1.11 with Whitenoise, and build my assets with:
Built assets are correctly added to the staticfiles.json manifest.
IF I use the version of the file in the query string, the file is served but Whitenoise does not add far into the future cache headers:
When I use the version placeholder:
I get an error when trying to render the template:
Versions: