加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 为网站设置expire标头需要多长时间?

发布时间:2020-12-16 07:15:22 所属栏目:asp.Net 来源:网络整理
导读:“Web pages are becoming increasingly complex with more scripts,style sheets,images,and Flash on them. A first-time visit to a page may require several HTTP requests to load all the components. By using Expires headers these components bec

“Web pages are becoming increasingly
complex with more scripts,style
sheets,images,and Flash on them. A
first-time visit to a page may require
several HTTP requests to load all the
components. By using Expires headers
these components become cacheable,
which avoids unnecessary HTTP requests
on subsequent page views. Expires
headers are most often associated with
images,but they can and should be
used on all page components including
scripts,style sheets,and Flash.”

正如Yslow所写.

我的问题是,为具有多个样式表,Flash标题,Javascripts,图像,PDF,MS Excel文件,PPT等的网站设置过期标题需要多长时间?

如果我想在所有事情上设置相同的过期时间.

解决方法

如果您的页面资源(images / css / js)通常不会更改并且是静态的,您可以将expires标头设置为远远超过1年的内容.

对于页面本身而言,它实际上取决于内容.如果您的内容经常更改,则应确保您的过期标头未设置为较大,否则您的访问者将收到过时的内容.

如果您考虑像SO本身这样的网站,内容会频繁更改,以至于页面上的过期标题非常小.从标题看起来,它们使用60秒的最大年龄并且从当前的1分钟开始有一个过期标题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读