ScriptManager.axd 不会缓存
好吧,这让我发疯。我已经搜索了几个小时&几乎尝试了所有方法,但使用 ScriptManager.axd 下载的脚本不会缓存。它们最终总是被标记为无缓存,且过期时间=-1。
我在以下链接中发布了此内容,但没有任何效果。
http://forums.asp.net/p/1728138/ 4639833.aspx/1?Re+ScriptManager+axd+and+caching
我尝试过的一些事情:
1)设置编译debug =“false”网络配置。
2) 添加了一个 HTTP 处理程序,用于搜索 ScriptManager.axd,然后设置标头。此处描述:http://www.componentart.com/community/forums/p/34409 /34409.aspx。我实际上在 http 处理程序中设置了一个断点 &确认它被击中了,但你猜怎么着?我为 ScriptResource.axd 设置的标头都没有出现在响应中!
3) 将此部分添加到 web.config。
<system.web.extensions >
<scripting >
<scriptResourceHandler enableCompression=“true” enableCaching=“true”/ >
</scripting >
</system.web.extensions >
4) 在 machine.config 中设置此属性
<configuration >
<system.web >
<deployment retail="true" />
</system.web >
</configuration >
5) 在 ScriptManager 标记中设置 ScriptMode="Release"。
说真的,什么给了?为什么这么难? ScriptManager 有那么 bug 吗?我错过了一些明显的事情吗?为什么我在 HTTP 处理程序中设置的响应属性最终没有出现在响应中?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查应用程序池管道模式。
此外,您的项目中可能有一些 Global.asax 文件可以覆盖缓存标头设置。
Check the Application pool pipeline mode.
Also there may be some Global.asax files in your project which can override the cache header settings.