Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
534 views
in Technique[技术] by (71.8m points)

browser - What is the difference between an F5 (refresh) of a page and pasting that URL in a new window?

What is the difference between an F5 (refresh) of a page and pasting that URL in a new window and clicking enter?

Any help is appreciated

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It depends on the caching policy for the page and the method used for fetching the page in the first place. If you fetched the page via a POST, a refresh will re-send the POST data while putting the URL in a new window will issue a GET to the server.

If the original request is a GET, the behaviour depends on how the current page is cached. Hitting refresh will cause the browser to check back with the server for the page (but not necessarily any scripts or images). If the page is set to be cacheable then pasting the URL in a new window might well just pull the page out of cache without hitting the server.

Note that checking with the server won't necessarily cause the page to be regenerated or redownloaded as the browser can issue a conditional GET or a HEAD request to check whether the page has actually changed since last fetched. Also, while some of the actions might pull the page from the cache, there's no guarantee it will (and dynamically generated pages usually have to be set up properly to be considered cacheable at all).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...