Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (45.3k points)

Is there any way to disable the caching of a single javascript file in my ASP.NET application without disabling the caching of any other files in the application?

It is running on IIS 7 in Azure, so to me it seems that my only options of controlling this are within the webserver tags.

I currently use the following config, but this is disabling cache on all files.

  <modules runAllManagedModulesForAllRequests="true"/>

    <staticContent>

      <clientCache cacheControlMode="DisableCache"/>

    </staticContent>

  </system.webServer>

I just want to disable cache of a single javascript file that changes quite often.

Is it possible?

1 Answer

0 votes
by (119k points)

Looks like the above answer is missing a "profiles" tag

<caching>

  <profiles>

    <add extension=".js" kernelCachePolicy="DontCache" policy="DontCache"/>

  </profiles>

</caching>

If you are looking for an online course to learn Azure, check out this Azure Training Course by Intellipaat.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

29.3k questions

30.6k answers

501 comments

104k users

Browse Categories

...