您的位置:首页 > 其它

一个小bug 看浏览器内核加载页面的方式

2011-04-29 22:08 375 查看
近日工作遇到一个另人困惑的问题,同一个页面,用不同的浏览器访问会有不同的问题

Firefox和IE浏览器一切正常没有问题,但是当用Webkit内核浏览器访问时,验证码无论如何通不过验证。

浏览服务器端日志,发现提交的数据都是一样的。

再仔细分析日志,发现加载流程不一样的:

WebKit流程如下:

Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:25) [GET]
Processing SimpleCaptchaController#simple_captcha (for 127.0.0.1 at 2011-04-29 17:37:29) [GET]
Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:30) [GET] //这里发生302错误
Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:31) [GET]
Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:32) [GET] //这里发生302错误
Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:33) [GET] //这里发生302错误
Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:35) [GET]
发现index加载了三次,导致验证码更新了三次(访问index会更新验证码)但是却只加载了一次。

Firefox和IE内核加载流程:
Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:25) [GET]
Processing SimpleCaptchaController#simple_captcha (for 127.0.0.1 at 2011-04-29 17:37:29) [GET]
Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:30) [GET] //这里发生302错误Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:32) [GET] //这里发生302错误
Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:33) [GET] //这里发生302错误

但是在IE下index却只加载了一次

不知道为什么WebKit会对同一个页面加载三次,难道是因为发生了302错误?
刚刚又测试了一下,把找不到的图片都添加上,则页面只加载一次,看来WebKit在页面上有图片找不到时会重新请求页面,但次数是多少我没有测试。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐