OK, this is driving me crazy. I’ve searched for hours & tried almost everything, but scripts downloaded with ScriptManager.axd will not cache. They ALWAYS end up marked as no-cache with a expires=-1.
I posted this at the following link , but none of that worked.
http://forums.asp.net/p/1728138/4639833.aspx/1?Re+ScriptManager+axd+and+caching
Some things I’ve tried:
1) Set compilation debug=”false” in web.config.
2) Added a HTTP handler that searched for ScriptManager.axd and then set headers. This is described here: http://www.componentart.com/community/forums/p/34409/34409.aspx. I actually set a breakpoint in the http handler & confirmed that it was being hit, but guess what? None of the headers I set for ScriptResource.axd ended up in the response!!!
3) Added this section to web.config.
<system.web.extensions >
<scripting >
<scriptResourceHandler enableCompression=“true” enableCaching=“true”/ >
</scripting >
</system.web.extensions >
4) set this attribute in machine.config
<configuration >
<system.web >
<deployment retail="true" />
</system.web >
</configuration >
5) Set ScriptMode=”Release” in the ScriptManager tag.
Seriously, what gives? Why is this so difficult? Is the ScriptManager that buggy? Am I missing something obvious? WHY didn’t the response attributes I set in the HTTP handler end up in the response?
Check the Application pool pipeline mode.
Also there may be some Global.asax files in your project which can override the cache header settings.