I have a website that's been running for 7 years. Recently we started seeing a problem where numbers were being added to the web page of a small number of users - the numbers would be hexadecimal numbers around 8000 - usually something like 1fxx where xx is another hex number. After some research, I found out that these appear on certain networks that use certain proxies and are related to Chunked Transfer encoding. For instance, we see it all the time with iOS 8 on AT&T, but didn't see it when we were running iOS 7 on AT&T. Some of the pages have code written many years ago and never had the problem until recently. Other pages are new. If the network is having a problem, it appears on all pages (new and old)
We found if we put a php header("HTTP/1.0 200 OK") at the top of the file, the problem is resolved for those networks with proxies that had the problem. However, on another set of people, often running Samsung Galaxy S5 machines, they now get an error that the site is not available. So if I force it to HTTP1.0, I make it stop working for some people. If I don't, other people have an issue. For most people, it works either way.
The web stack is CentOS release 6.5, Apache/2.0.64, MySQL 5.1.73, PHP 5.2.9.
Is there something I can put in to detect whether I should put in the HTTP1.0 header or not? And what should I look for to try and make it start working with those proxies that cause the chunked transfer encoding to not be correctly interpreted. Is there some way to increase the size of the chunked data so the entire page goes in one chunk?