Get updated JS file after bundling

339 views Asked by At

I am creating an ASP.Net MVC application. I have added a bundle for javascript files as below.

bundles.Add(new ScriptBundle("~/Content/surveyJS").Include(
          "~/Content/javascript/jquery-3.0.0.js",
          "~/Content/javascript/questionaire.js"));

I have updated questionaire.js and pressed ctrl + f5 but browser doesn't download new file.

I have also added ?v=1 at the end of file name to remove cache but it is not not downloading any file (not even older one).

bundles.Add(new ScriptBundle("~/Content/surveyJS").Include(
          "~/Content/javascript/jquery-3.0.0.js",
          "~/Content/javascript/questionaire.js?v=1"));

I have also tried calling that bundle with ?v=1

@Scripts.Render("~/Content/surveyJS?v=1")

but again, it does not download any file.

Please provide solution that I can use in production as well (means no rebuilding project or changing config solutions).

1

There are 1 answers

3
EverCode On

If you're running on a windows server you can try to reset the IIS or clear the server cache.

https://learn.microsoft.com/en-us/iis/extensions/configuring-application-request-routing-arr/delete-cached-objects