Sự Khác Nhau Giữa F5 Và Ctrl + F5 Là Gì

I once did experiment in IE6 và Firefox 2.x. The F5 refresh would trigger a HTTPhường request sent lớn the VPS with an If-Modified-Since header, while Ctrl + F5 would not have sầu such a header. In my understanding, F5 will try khổng lồ utilize cached nội dung as much as possible, while Ctrl + F5 is intended khổng lồ abandon all cached nội dung & just retrieve all nội dung from the servers again.

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

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

http browser caching cross-browser refresh Share Improve this question Follow edited Atruyền thông quảng cáo 9 "16 at 9:51
*

Krzysztof Krasoń 23k1414 gold badges7777 silver badges9999 bronze badges asked Dec 22 "08 at 2:00
*

Morgan ChengMorgan Cheng 65.6k6363 gold badges165165 silver badges223223 bronze badges 3 Add a bình luận |

6 Answers 6

Active Oldest Votes326Generally speaking:

F5 may give sầu you the same page even if the nội dung is changed, because it may load the page from cađậy. But Ctrl-F5 forces a cađậy refresh, và will guarantee that if the nội dung is changed, you will get the new content.Bạn sẽ xem: Ctrl f5 là gì

Share Improve this answer Follow edited Mar 11 "14 at 9:20
*

naXa 25.8k1414 gold badges153153 silver badges212212 bronze badges answered Dec 22 "08 at 2:10
*

dancavallarodancavallaro 12.5k77 gold badges3333 silver badges3333 bronze badges 4 Add a comment | 526It is up khổng lồ the browser but they behave sầu in similar ways.

Bạn đang xem: Sự Khác Nhau Giữa F5 Và Ctrl + F5 Là Gì

I have tested FF, IE7, Opera và Chrome.

F5 usually updates the page only if it is modified. The browser usually tries khổng lồ use all types of cache as much as possible và adds an "If-modified-since" header lớn the request. Opera differs by sending a "Cache-Control: no-cache".

CTRL-F5 is used to force an update, disregarding any cađậy. IE7 adds an "Cache-Control: no-cache", as does FF, which also adds "Pragma: no-cache". Chrome does a normal "If-modified-since" & Opera ignores the key.

Edit: Updated table

The table below is updated with information on what will happen when the browser"s refresh-button is clicked (after a request by Joel Coehoorn), & the "max-age=0" Cache-control-header.

Xem thêm:

Updated table, 27 September 2010

┌────────────┬───────────────────────────────────────────────┐│ UPDATED │ Firefox 3.x ││27 SEP 2010 │ ┌────────────────────────────────────────────┤│ │ │ MSIE 8, 7 ││ Version 3 │ │ ┌─────────────────────────────────────────┤│ │ │ │ Chrome 6.0 ││ │ │ │ ┌──────────────────────────────────────┤│ │ │ │ │ Chrome 1.0 ││ │ │ │ │ ┌───────────────────────────────────┤│ │ │ │ │ │ Opera 10, 9 ││ │ │ │ │ │ ┌────────────────────────────────┤│ │ │ │ │ │ │ │├────────────┼──┼──┼──┼──┼──┼────────────────────────────────┤│ F5│IM│I │IM│IM│C │ ││ SHIFT-F5│- │- │CP│IM│- │ Legend: ││ CTRL-F5│CP│C │CP│IM│- │ I = "If-Modified-Since" ││ ALT-F5│- │- │- │- │*2│ P. = "Pragma: No-cache" ││ ALTGR-F5│- │I │- │- │- │ C = "Cache-Control: no-cache" │├────────────┼──┼──┼──┼──┼──┤ M = "Cache-Control: max-age=0" ││ CTRL-R│IM│I │IM│IM│C │ - = ignored ││CTRL-SHIFT-R│CP│- │CP│- │- │ │├────────────┼──┼──┼──┼──┼──┤ ││ Click│IM│I │IM│IM│C │ With "click" I refer khổng lồ a ││ Shift-Click│CP│I │CP│IM│C │ mouse cliông chồng on the browsers ││ Ctrl-Click│*1│C │CP│IM│C │ refresh-icon. ││ Alt-Click│IM│I │IM│IM│C │ ││ AltGr-Click│IM│I │- │IM│- │ │└────────────┴──┴──┴──┴──┴──┴────────────────────────────────┘Versions tested:

Firefox 3.1.6 and 3.0.6 (WINXP)MSIE 8.0.6001 và 7.0.5730.11 (WINXP)Chrome 6.0.472.63 and 1.0.151.48 (WINXP)Opera 10.62 and 9.61 (WINXP)

Notes:

Version 3.0.6 sends I và C, but 3.1.6 opens the page in a new tab,making a normal request with only "I".

Version 10.62 does nothing. 9.61 might bởi vì C unless it was a typo in my old table.

lưu ý about Chrome 6.0.472: If you bởi vì a forced reload (like CTRL-F5) it behaves lượt thích the url is internally marked to always vày a forced reload. The flag is cleared if you go lớn the address bar và press enter.