浏览器如何与到期标头,缓存控制标头,最后修改标头一起使用? [英] How does browser work with expiration headers, cache-control headers, last-modified-header?

查看:78
本文介绍了浏览器如何与到期标头,缓存控制标头,最后修改标头一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名Web开发人员,曾经使用过PHP和.NET。拥有超过一年的网络工作经验,我还无法完全理解浏览器的缓存功能,希望这里的Web Gurus可以为我提供帮助。我想到的问题是:




  • 浏览器实际上是如何缓存内容的,它是否要求查看缓存文件是否已更改还是不使用服务器,

  • 对于开发人员来说,充分利用浏览器缓存的理想方式是什么,同时又能毫不费力地在网站上进行新更改所有。我认为,如果浏览器以某种方式缓存了我的CSS,JS和图像,然后每次仅检查它们对服务器的修改,就可以解决问题。但是我不确定该怎么做。


解决方案

此博客文章可能会帮助您: / p>

http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/



它说明了如何使用缓存,同时保持了在需要时进行更改的能力。


I am a web developer, have worked with PHP and .NET both. having over a year of experience working on web I haven't been able to understand the browser caching features thoroughly, I hope Web Gurus here can help me with it. Questions I have in my mind are:

  • How does browser actually caches stuff, does it request for to see if the cached file has changed on the server or not,
  • What is the Ideal way for a developer to make use of browser caching to its full, but also to be able to push new changes on the site with no hassle at all. I think if browser somehow caches my CSS and JS and Images, and then just makes a checks for their modification to the server every time, this can sort the issue. but I am not sure how to do it.

解决方案

This blog post may help:

http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/

It explains how to use of caching, whilst maintaining the ability to make changes when required.

这篇关于浏览器如何与到期标头,缓存控制标头,最后修改标头一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆