Stop browser to make HTTP requests for images that should stay cached - mod_expires

后端 未结 10 1041
猫巷女王i
猫巷女王i 2020-12-04 10:01

After reading many articles and some questions on here, I finally succeded in activating the Apache mod_expires to tell the browser it MUST cache images

10条回答
  •  忘掉有多难
    2020-12-04 10:37

    What you are seeing in Chrome is not a record of the actual HTTP requests - it's a record of asset requests. Chrome does this to show you that an asset is actually being requested by the page. However, this view does not really actually indicate if the request is being made. If an asset is cached, Chrome will never actually create the underlying HTTP request.

    You can also confirm this by hovering over the purple segments in the timeline. Cached resources will have a (from cache) in the tooltip.

    In order to see the actual HTTP requests, you need to look on a lower level. In some browsers this can be done with a plugin (like Live HTTP Headers).

    In reality though, to verify the requests are not actually being made you need to check your server logs or use a debugging proxy like Charles or Fiddler. This will work on an HTTP level to make sure the requests are not actually happening.

提交回复
热议问题