iOS 网页错误通过蜂窝数据而不是通过 Wifi?最近对 AT&T 蜂窝网络的更改? [英] iOS Web page errors over Cellular Data but not over Wifi? Recent change to AT&T Cellular network?

查看:26
本文介绍了iOS 网页错误通过蜂窝数据而不是通过 Wifi?最近对 AT&T 蜂窝网络的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了某些 iOS 网页(在移动 Safari、Chrome 和应用程序中的 iOS Webviews 中)通过蜂窝数据与 Wifi 的问题,

I'm encountering an issue with certain iOS web pages (in both mobile Safari, Chrome, and in also iOS Webviews in app) over cellular data vs. Wifi,

该问题与之前其他人在此处发布的问题相同:

The issue is identical to what was previously posted by someone else here:

移动 Safari 仅蜂窝加载错误

不幸的是,上面的 URL 还没有发布答案.

Unfortunately no answers yet posted to the above URL.

基本上,我一直在 HTML 中看到来自蜂窝数据的无关的随机垃圾字符,但通过 Wifi 加载同一页面完全没问题.这不是下载速度或连接不良的问题,它似乎是蜂窝网络上的一些莫名其妙的数据传输/解释故障.我已经能够在不同的位置和不同的设备上复制相同的问题.

Basically, I'm consistently seeing extraneous random garbage characters in the HTML that comes down from cellular data, but the same page loading perfectly okay via Wifi. This isn't a download speed or poor connection issue, it seems to be some inexplicable data transfer/interpretation malfunction over the cellular network. I've been able to replicate the same problem at different locations and with different devices.

在 Wifi 下可以正常加载但在数据上加载错误(由于上述无关垃圾字符导致的 JavaScript 和 CSS 错误)的页面示例如下:

An example of a page that loads okay with Wifi but loads with errors (JavaScript and CSS errors because of the aforementioned extraneous garbage characters) over data is here:

http://www.ear-say.com

有没有其他人遇到过同样的问题?非常感谢任何见解.

Has anyone else encountered the same issue? Any insights greatly appreciated.

推荐答案

内容类型不是问题,但这让我更多地思考页面如何在我的服务器、网络以及最终客户.

The content-type wasn't the issue, but that got me thinking more about how the pages were possibly being transformed between my server, the network, and ultimately the client.

经过反复试验,我消除了 JQuery 引用,然后页面通过 AT&T 蜂窝数据正确加载.这导致了另一次 Google 搜索,并最终根据以下网址找到了问题的答案:

After some trial and error I eliminated JQuery references, after which the pages then loaded correctly over AT&T celullar data. That led to another Google search, and ultimately the answer to the problem as per the below URLs:

http://bugs.jquery.com/ticket/8917

... 上面的 JQuery 错误报告引用了这两个 URL 的修复,其中一个实际上来自 stackoverflow:

... The above JQuery bug report referenced fixes at these two URLs, one of which was actually from stackoverflow:

http://mobiforge.com/design-development/setting-http-headers-advise-transcoding-proxies

网络网站在 iPad/iPhone 上在 3G 下显示 JavaScript 错误,但在 WiFi 下没有

总而言之,问题在于 AT&T 蜂窝数据网络最近发生了变化,类似于上述 URL 中描述的变化.即 AT&T 在将某些 Web 内容发送到 iPhone 和 iPad 之前以某种方式对其进行修改.修复方法很简单,只需为不想被 AT&T 网络更改/转换的页面设置 Cache-Controlno-transform"标头.

In summary, the issue is with a recent change at the AT&T cellular data network, similar to that described in the above URLs. i.e. AT&T is in some way modifying certain web content before sending it on to iPhones and iPads. The fix is simple, just set the Cache-Control "no-transform" header for pages you don't want changed/transformed by the AT&T network.

我通过以下方式在 PHP 中手动设置选定页面的标题:

I'm manually setting the header in PHP for select pages via:

header("Cache-Control: no-transform");

header("Cache-Control: no-transform");

.... 但我认为它可以在目录的 .htaccess 文件中全局设置,或者为虚拟主机文件中的域或 httpd.conf 文件中的整个服务器设置,例如:

.... but I assume it could be globally set in a directory's .htaccess file, or for the domain in the virtual host file or the entire server in the httpd.conf file, e.g.:

标头集缓存控制无转换"

Header set Cache-Control "no-transform"

我不知道设置no-transform"会如何影响性能,我远非 Apache 配置设置或网络方面的专家,但以上至少现在解决了最初的问题.

I don't know how setting "no-transform" will effect performance, I'm far from an expert on Apache configuration settings or networks, but the above has at least for now solved the initial problem.

这篇关于iOS 网页错误通过蜂窝数据而不是通过 Wifi?最近对 AT&T 蜂窝网络的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆