3

In my web.config I have staticContent clientCache and it works perfectly.

However, I wanted more specific cache based on the different types of file extension. So I'm trying to accomplish this using the Caching Profiles.

<add extension=".js"  policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="00:10:00" location="Downstream" varyByQueryString="*"/>

With staticContent - clientCache, I can look at the headers and it returns a "Cache-Control:max-age=600". However, with my Caching Profiles.. it doesn't work. Any advice would be greatly appreciated?

JGood
  • 522
  • 6
  • 23
  • Did you ever figure this out? I see you did not get any help... – Jeremy A. West Feb 17 '17 at 15:05
  • Jeremy, my particular use case was to handle JavaScript files and I do not recommend this in the slightest for js files. What's the use case you are trying to accomplish? – JGood Feb 28 '17 at 22:48
  • Using Angular and did not want to cache the .html templates. Angular has it's own caching technique for this. I want them to reload each time the application runs. Did not want to affect my .css and .js files. – Jeremy A. West Mar 06 '17 at 15:40
  • Ah, who hasn't ran into this annoyance? Most people warn to be careful about blocking the caching as it makes things faster for us, but I have had issues and done something like this: templateUrl: 'modaltpl.html?d=' + Date.now() and in IIS.. – JGood Mar 06 '17 at 23:27
  • Actually check out: http://stackoverflow.com/questions/14718826/angularjs-disable-partial-caching-on-dev-machine – JGood Mar 06 '17 at 23:28
  • Thanks man, going read it now. In my case (this time) it is an internal application. I just put an 8 hour expiration on all static content and moved on. If they want a fix it will be ready tomorrow :) – Jeremy A. West Mar 07 '17 at 16:48
  • Always happy to help. :) – JGood Mar 08 '17 at 23:10

0 Answers0