【发布时间】:2011-04-01 09:30:31
【问题描述】:
我正在开发一个 asp.net 网站,就像普通用户一样,我们在编码和测试期间使用 asp.net 开发人员服务器。 今天,我发现firefox没有缓存我网站的任何静态文件,因为我们的应用程序很大,它使页面加载时间很慢。 我检查了firefox about:cache,所有的静态文件缓存设置看起来像
Key: http://localhost:26851/App_Layout/icons/actions/email/folder.png
Data size: 871 bytes
Fetch count: 1
Last modified: 2010-08-19 11:59:46
Expires: 1969-12-31 16:00:00
Key: http://localhost:26851/Framework/ScriptLibrary/JQueryPlugins/ui.mouse.js
Data size: 5079 bytes
Fetch count: 1
Last modified: 2010-08-19 11:59:39
Expires: 1969-12-31 16:00:00
FireBug 显示这样的标题
Server ASP.NET Development Server/9.0.0.0
Date Thu, 19 Aug 2010 22:10:27 GMT
X-AspNet-Version 2.0.50727
Cache-Control public
Etag "1CB3F32C834A880"
Content-Type text/css
Content-Length 1775
Connection Close
Firebug 有另一个标签叫做“缓存”,信息是:
Last Modified Thu Aug 19 2010 15:10:27 GMT-0700 (Pacific Daylight Time)
Last Fetched Thu Aug 19 2010 15:10:27 GMT-0700 (Pacific Daylight Time)
Expires Wed Dec 31 1969 16:00:00 GMT-0800 (Pacific Standard Time)
Data Size 1775
Fetch Count 10
Device disk
过期日期设置回 1969-12-31,我相信这就是它们加载时间非常长的原因。 我正在使用 Visual Studio 2008、Windows 7 机器。该应用程序在 IE 中运行良好,内容被正确缓存。
以前有人见过这种行为吗?
【问题讨论】:
-
使用Live Http Headers 或类似名称,然后发布您的网站发送的实际响应标头。
标签: asp.net http firefox browser caching