简体   繁体   English

重新启动后浏览器不缓存资源

[英]browser does not cache resources after restart

This is more a general caching question. 这是一个更一般的缓存问题。

In my project I have pages with a couple ext.net 2.0 beta controls with asp.net-mvc3/razor 在我的项目中,我的页面包含几个带有asp.net-mvc3/razor ext.net 2.0 beta控件

So for these pages, from the data I gather in firebug, I think that the browser isn't caching the ext.axd resource files after it is restarted . 因此,对于这些页面,从我在firebug中收集的数据来看,我认为浏览器在重新启动后不会缓存ext.axd资源文件。

This is what I see: 这是我看到的:

  1. Start Firefox, goto my page 启动Firefox,转到我的页面
  2. All requests show 200 OK 所有请求显示200 OK
  3. If I press F5 , I see all the requests as 304 Not Modified 如果按F5键,我看到的所有请求都为304 Not Modified
  4. Now, if I restart the browser, it goes back to Http 200 responses. 现在,如果我重新启动浏览器,它将返回到Http 200响应。

Is browser NOT caching my resources? 浏览器是否不缓存我的资源? Is there a setting or config I can employ for it to cache my resources across browser sessions? 我是否可以使用某个设置或配置来在浏览器会话之间缓存我的资源?

This is what firebug looks like: 这是萤火虫的样子:

  1. When I first start: 当我第一次开始:
    在此处输入图片说明

  2. When I press F5 this is what I see: 当我按F5键时,我看到的是:

    在此处输入图片说明

    This is what an individual request looks like: 这是单个请求的样子:

    在此处输入图片说明

    When I restart the browser , I go back to (1) . 重新启动浏览器时 ,我返回(1) I get 200OK everywhere. 我到处都能拿到200OK

(1) Are the resources being cached? (1)是否正在缓存资源? (2) Is there something I can do to cache it? (2)有什么我可以缓存的东西吗?

The line items on initial request are 'black' and fetched from original source. 最初请求时的订单项为“黑色”,并从原始来源获取。 The items are then added to browser cache. 然后将项目添加到浏览器缓存中。

On subsequent requests, the items are pulled directly from cache, and coloured 'gray'. 在随后的请求中,这些项目会直接从缓存中提取,并显示为“灰色”。 I guess this is just a 'feature' of Firebug. 我想这只是Firebug的“功能”。

More information is available at the following locations: 在以下位置可以找到更多信息:

http://forums.ext.net/showthread.php?18340-Browser-does-not-cache-resources-after-restart http://forums.ext.net/showthread.php?18340-Browser-does-not-cache-resources-after-restart

How to interpret grey items in Firebug Net panel? 如何在Firebug Net面板中解释灰色项?

Hope this helps 希望这可以帮助

Usually caching is controlled by web server. 通常,缓存是由Web服务器控制的。 What's your web server and what's the configuration for the directory where your app is? 您的Web服务器是什么,应用程序所在目录的配置是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM