似乎在基于 Webkit 的浏览器(Chrome 和 Safari)中,当在服务器上执行 Post/Redirect/Get 时,整个页面(html + images + css 等)都会重新下载。它看起来就像您重新加载页面一样。
在 Google Chrome 帮助中发布了一个问题(以及某种程度上的解决方案):http://www.google.com/support/forum/p/Chrome/thread?tid=72bf3773f7e66d68&hl=en
有没有人有更优雅的方式来做到这一点?我正在使用 ASP.NET MVC,并且不想编写返回 Javascript 或基于 UserAgent 的实际页面的自定义重定向结果。
我应该只是希望并等待 Webkit 会改变它的行为吗?
最佳答案
这是一个错误。到目前为止,我看到的唯一“解决方法”是使用 Refresh header 而不是 Location header 来进行重定向。这远非理想。
Bug 38690 - Submitting a POST that leads to a server redirect causes all cached items to redownload
此外,此问题与“Full page reload on Post/Redirect/Get ignoring cache control”重复。
关于asp.net-mvc - Webkit 中的 Post/Redirect/Get 会导致整个页面重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3114962/