We are developing a web mobile application using DWR as Ajax framework and we are getting errors in Nexus 4 devices which have enabled the option Reduce data usage in the Bandwidth Management setting. The error displays an alert saying Error 502: Bad gateway and it happens when refreshing a page that calls a DWR method in the onload event.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
(I am the lead on the Chrome data compression proxy.)
The problem is a bug in the DWR library which uses JavaScript comments to contain semantically-meaningful content. The Chrome data compression proxy removes JS comments, which it is allowed to do by the headers; the fix is for DWR to use "Cache-Control: no-transform" in the DWR response headers. I emailed the DWR dev list a while back to ask about this but never heard back. We are looking for a general purpose workaround but in the meantime there's no easy fix unless DWR is fixed to work through HTTP proxies.