SaaS CMS has officially launched! Learn more now.

Suggestion: add a "v=123456789" query parameter to static file urls


When using the UrlHelper extension Url.ContentUrl(this UrlHelper urlHelper, ContentReference contentLink) I get a url in the form http://domain/globalassets/file.txt. As this is static content it gets cached by most browsers. If an editor edits the file.txt file and decides to replace the existing file when uploaded to the assets manager, the url will still be same. Whouldn't it be better if updated static files gets a query parameter appended (e.g. http://domain/globalassets/file.txt?v=123456789) in order to trigger a refresh by the browser?

Feb 21, 2014 11:10

Hmmm.. this post really received a screwed layout. Maybe you should look into that as well ;)

Feb 21, 2014 12:00

I've got a module that handles this, but only for images. Maybe you can extend that? I just uploaded it here: . It just handles images, but feel free to add support for any media types. I will create a nuget package for it soon.

Edited, Feb 22, 2014 23:01

Thanks Torjus! I will have a look at it :)

Mar 05, 2014 9:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.