1

We have a problem: anytime we deploy a new version

cache must be cleared on every browser to refresh the js and css code.

Is there any built-in tool to generate a unique timestamp in the js name?

update1

I tried to bundle my js, but yet no stamp is auto generated

bundles:

   `bundles.Add(new ScriptBundle("~/bundles/abTestingAdmin").Include( "~/Scripts/abTestingAdmin.js"));`

aspx:

<script src="<%: Url.Content("~/bundles/abTestingAdmin") %>" type="text/javascript"></script>

from the browser console

<script src="/bundles/abTestingAdmin" type="text/javascript"></script>

Elad Benda
  • 35,076
  • 87
  • 265
  • 471

1 Answers1

4

If you register your CSS files and your JS files using Bundles (full example here), both types of files will be minified, combined and a unique URL parameter will be added automatically when you deploy your app so that browsers are forced to grab it again.

Icarus
  • 63,293
  • 14
  • 100
  • 115