0

Consider this scenario:

a browser requests for a website and sends a request to a server (let's call it A). A responds with a 307 redirect with some content on server B as the location. Now the browser sends a request to server B to get this content.

A few mts later, the user refreshes the page.

what happens now? From a test I did on Chrome, it looks like, on refresh, we are fetching the local content from the browser cache and not contacting server A or server B.

Wanted to know if this is common behavior across all browsers. Is there a possibility that a browser may, on refresh, instead of contacting server A or its local cache, send a request to server B instead?

please let me know...thanks in advance!!

Omi
  • 976
  • 2
  • 20
  • 35

1 Answers1

0

On a user refresh, the browser will refresh the content from server "B". This may or may not result in hitting the cache rather than the server, depending on the HTTP response headers Expires and Cache-Control and what type of refresh the user performs. http://blogs.msdn.com/b/ieinternals/archive/2010/07/08/technical-information-about-conditional-http-requests-and-the-refresh-button.aspx

EricLaw
  • 56,563
  • 7
  • 151
  • 196
  • EricLaw: From this article, it looks like once "Expires" value is hit, the browser will get the content from server instead of cache. But my questions is whether there is a possibility of the browser, on refresh, directly contacting server B (without contacting server A)? I understand the browser may contact server A and then server B once redirected. But I am trying to see if, on refresh, there is a possibility of the browser directly contacting server B directly instead of A. – Omi Jul 17 '15 at 04:52
  • The browser will ALWAYS contact "B" and not "A" for the refresh, as B's is the URL in the address bar. – EricLaw Jul 17 '15 at 12:02
  • EricLaw: shouldn't the browser display the URL for A in the address bar (not B's URL...the user (the common man) in fact should not even be aware of B..unless he digs into the flow using some tool)? – Omi Jul 17 '15 at 13:46
  • No, a 30x redirect updates the browser address bar. Try it. – EricLaw Jul 17 '15 at 13:47