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

近日工作遇到一个另人困惑的问题,同一个页面,用不同的浏览器访问会有不同的问题

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在页面上有图片找不到时会重新请求页面,但次数是多少我没有测试。 

转载于:https://www.cnblogs.com/heimirror/archive/2011/04/29/2033146.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值