When using Bundles with EnableOptimisations set to true, the output URL contains a hash so that the browser cannot load the file from the cache if it has changed.
@Scripts.Render("~/content/js/global")
Outputs:
<script src="/content/js/global?v=PqstRRGF8qsUsJfHu6NBBBp6eDxYBz1JCbHY6CQJVks3"></script>
However, some files in our application refer to only one page. We directly refer to them:
@Scripts.Render("~/areas/areaname/content/js/page-name.js")
The output URL in this case has no hash and therefore is cached, which causes problems when releasing changes to these files.
We do not change each link individually or do not have to manually change the URLs each time we change files.
How can I globally add a hash (or version number) to all script and stylish urls not ?
source share