Skip to content Skip to sidebar Skip to footer

Chrome And Safari Caching 302 Redirect

Various flavors of this have been asked already, but I've yet to see a real answer for this. We have a separate image service that our web app uses to get some of its images. The

Solution 1:

cache-control: no-store

I had the same maddening problem that you described (slightly different in that it was a missing cookie redirect back to the login page) that worked everywhere but Safari.

In desperation, I came across this open WebKit bug and saw the fateful comment (and finally a glimmer of hope):

CachedRawResource now keeps the redirect chain, and has some trivial logic for checking correctness, but it's nowhere near complete (only checks cacheControlContainsNoStore()). And of course other resource types don't have anything.

Added no-store to my cache-control header and no more problem.

Solution 2:

Please read this.. https://www.hochmanconsultants.com/articles/301-versus-302.shtml

Chrome has pretty aggressive caching.

When you use a temporary redirect, you are basically saying that the actual URL is temporarily unavailable so use this other URL instead. Chrome rightly caches the old URL because it is still valid. Try a 301 instead. Then Chrome should know that the original URL is no longer valid.

Post a Comment for "Chrome And Safari Caching 302 Redirect"