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>

2
  • stackoverflow.com/a/8316991/425003 Commented Jan 9, 2013 at 15:13
  • You can use bundling for this. EDIT: Exactly as Icarus said. Commented Jan 9, 2013 at 15:13

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

did bundle, but not stamp is autoGenerated: <script src="/bundles/abTestingAdmin" type="text/javascript"></script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.