浏览器的“F5"有什么请求?和“Ctrl + F5"刷新生成? [英] What requests do browsers' "F5" and "Ctrl + F5" refreshes generate?

查看:33
本文介绍了浏览器的“F5"有什么请求?和“Ctrl + F5"刷新生成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于F5Ctrl+F5 在网络浏览器中触发的动作是否有标准?

Is there a standard for what actions F5 and Ctrl+F5 trigger in web browsers?

我曾经在 IE6 和 Firefox 2.x 中做过实验.F5 刷新会触发一个带有 If-Modified-Since 标头的 HTTP 请求发送到服务器,而 Ctrl+F5 不会有这样的标题.在我的理解中,F5 会尽量利用缓存的内容,而 Ctrl+F5 的目的是放弃所有缓存的内容,只是再次从服务器检索所有内容.

I once did experiment in IE6 and Firefox 2.x. The F5 refresh would trigger a HTTP request sent to the server with an If-Modified-Since header, while Ctrl+F5 would not have such a header. In my understanding, F5 will try to utilize cached content as much as possible, while Ctrl+F5 is intended to abandon all cached content and just retrieve all content from the servers again.

但今天,我注意到在一些最新的浏览器(Chrome、IE8)中,它不再以这种方式工作了.F5Ctrl+F5 都发送 If-Modified-Since 标头.

But today, I noticed that in some of the latest browsers (Chrome, IE8) it doesn't work in this way anymore. Both F5 and Ctrl+F5 send the If-Modified-Since header.

那么这应该如何工作,或者(如果没有标准)主要浏览器在实现这些刷新功能的方式上有何不同?

So how is this supposed to work, or (if there is no standard) how do the major browsers differ in how they implement these refresh features?

推荐答案

一般来说:

F5 即使内容改变也可能给你相同的页面,因为它可能从缓存中加载页面.但是Ctrl+F5强制刷新缓存,并保证如果内容改变,你会得到新的内容.

F5 may give you the same page even if the content is changed, because it may load the page from cache. But Ctrl+F5 forces a cache refresh, and will guarantee that if the content is changed, you will get the new content.

这篇关于浏览器的“F5"有什么请求?和“Ctrl + F5"刷新生成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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