Add cache busting querystring to block definition files #15290
skttl
started this conversation in
Features and ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When adding custom views / stylesheets / thumbnails to a block definition, you choose between static files. This is fine - but we generally cache static files almost infinitely, and rely on the
asp-append-version
tag helper in our frontend to make sure the cache is busted when needed.It would be nice, if Umbraco could do something similar when fetching the assets, especially the view and the stylesheet.
IIRC, the Property Value Converter does something to convert a database value to an editorvalue. In here we could inject
IFileVersionProvider
and use that to get the current file version, and append it as a querystring.This way we get our extreme caching, but we bust it when needed.
Currently my workaround is to use custom middleware, that triggers if a querystring contains
v=auto
, and redirects the request to eg.main.css?v=G3TuWl9se8I19ihg4VRQoYIYrBSohtJSzxY4mJhmG-8
. But this requires me to add the querystring through the database (or by tampering with uda/usync files)Beta Was this translation helpful? Give feedback.
All reactions