dsft8327 2012-08-25 08:45
浏览 13

Google缓存重新验证

I've got a problem with Google Chrome: if i call up an address, google connects two times to the webserver - but only sometimes. I think that has something to do with the cache-control. Every time that happens, the header HTTP_CACHE_CONTROL is not set in the request. Otherwise it's set to max-age=0. I don't want Chrome to connect two times to my script - do you know a solution?

I hope you can help me! Thank You!

EDIT: maybe it's important to know: in that script there is a 301-redirect.

EDIT 2: i disabled the "HTTP_CACHE_CONTROL max-age=0" - same problem.

Furthermore: if i call up "http://localhost/admin?foo=bar" there is no GET-variable "foo" in the first request - but in the second there is.

EDIT 3: If i use javascript instead of the location-header for the redirection, everything works fine.

EDIT 4: you can test it: download this and unzip it. Put it in the folder "www/chrome-test/", so you can call up "http://localhost/chrome-test/redirect/".

Everytime you call up "http://localhost/chrome-test/redirect/" you'll be redirected to "http://localhost/chrome-test/example/". A message generated by the redirect-Script is shown. I use Sessions to "transport" this message. Then call up "http://localhost/chrome-test/redirect/" again (USE THE ADDRESS BAR AND PRESS RETURN!!!!). Repeat this last step a few times (maybe 20 times). Sometimes the message "This is a message..." is shown two times - so the redirect-script run two times. But why?

  • 写回答

1条回答 默认 最新

  • douyi6755 2015-01-21 00:26
    关注

    Does your icon for the page appears in the Chrome browser? If not, Chrome looking for favicon.ico, and if your site return 404 page with same code, chrome will do it twice.

    <link rel="icon" href="/favicon.ico" sizes="32x32" type="image/png" />
    
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!