In MVC-4, bundles for compressing CSS & Js files can be linked in a layout file with this Razor syntax: @Scripts.Render("~/JavaScripts")
This generates a link in the layout file that includes a fingerprint, which is re-generated on each app-build, to assist with cache-control.
So the generated link looks like:
<script src="/JavaScripts?v=dSMc_JTHMMP5GrWnILSYt_QBMw-g1pPlzknSorXpkyQ1"></script>
I'd like to know how the fingerprint is being generated (to use for similar purposes), but Sytem.Web.Optimization is not yet open-source.
The fingerprint is generated using a sha256 hash of the bytes from the bundle and then encoded:
byte[] hash = sha256.ComputeHash(Encoding.Unicode.GetBytes(bundle));
return HttpServerUtility.UrlTokenEncode(hash);