Okay, this is driving me crazy. I searched the clock and tried almost everything, but scripts downloaded using ScriptManager.axd will not be cached. They are ALWAYS ultimately flagged as no-cache with expires = -1.
I posted this on the following link, but none of this worked.
http://forums.asp.net/p/1728138/4639833.aspx/1?Re+ScriptManager+axd+and+caching
Some things I tried:
1) Set the compilation debug = "false" in web.config.
2) Added an HTTP handler that looked for ScriptManager.axd and then set the headers. This is described here: http://www.componentart.com/community/forums/p/34409/34409.aspx . I actually set a breakpoint in the http handler and confirmed that it hit, but guess what? None of the headers I set for ScriptResource.axd got the answer !!!
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 the machine.config file
<configuration >
<system.web >
<deployment retail="true" />
</system.web >
</configuration >
5) Set ScriptMode = "Release" in the ScriptManager tag.
Seriously, what gives? Why is it so hard? Is ScriptManager an error? Am I missing something? WHY were there no response attributes set in the HTTP handler in the response?