Chrome and Safari caching 302 redirect

后端 未结 2 1357
我在风中等你
我在风中等你 2020-12-30 12:08

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 i

相关标签:
2条回答
  • 2020-12-30 12:50

    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.

    0 讨论(0)
  • 2020-12-30 12:53

    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.

    0 讨论(0)
提交回复
热议问题