1

So we have this website, and as far as I can tell only through the Virgin Mobile 3G cellular network (on an iPhone 4), HTML pages have all of the script and style tags in the head with a src set to a URL inlined within the document.

Merely switching to WiFi or using a device with a different cellular network (like AT&T) and the HTML page will not change.

I can see how this is an optimization to speedup the load time of pages, but one of our scripts will only work if they are not inlined.

Example response not using the Cellular network:

<html>
  <head>
    <script type="text/javascript" src="http://oursite.com/script.js"></script>
  </head>
</html>

What we get using the Cellular network:

<html>
  <head>
    <script style="display: none">
      // The contents of http://oursite.com/script.js (this is bad)
    </script>
  </head>
</html>

Is this actually the case or am I just insane? Is there a way to prevent the cellular provider from inlining our script elements?

4

3 回答 3

1

添加 Cache-Control: no-transform 已解决此问题。

于 2013-07-03T14:21:04.703 回答
0

网络,尤其是移动网络,会做各种各样的事情,包括内嵌内容、压缩(甚至调整大小)图形和转码。根据运营商的不同,您可能(或可能不)能够在请求和/或响应中设置一些标头以抑制部分或全部这些行为。

于 2013-07-02T19:24:08.887 回答
-1

互联网服务提供商、网络主机甚至病毒软件都可能会破坏您的页面。在您的情况下,移动提供商可能正在这样做 - 或者浏览器正在使用优化页面的代理。

您正在运行哪些无法处理内联的代码?也许可以对其进行调整以使其以任何一种方式工作?

于 2013-07-02T19:24:18.090 回答