[solved] problem with PHP caching proxy (white lines between tiles)

hello everybody,
I tried to follow these instuctions in order to create a proxy and reduce the impact of my application on the official tile servers https://wiki.openstreetmap.org/wiki/ProxySimplePHP

I generate the map with this code, wich works perfectly without the proxy (commented row):

	<script defer type="text/javascript">

    window.addEventListener( 'DOMContentLoaded', function() {

	const center = ol.proj.transform([11.3387500, 44.4938100], 'EPSG:4326', 'EPSG:3857');

	var vectorSource = new ol.source.Vector();

	var vectorLayer = new ol.layer.Vector({
	    source: vectorSource

	var map = new ol.Map({
	target: 'map',
	    layers: [
		new ol.layer.Tile({
//		    source: new ol.source.OSM()
		    source: new ol.source.OSM({url: 'http://glisweb.videoarts.eu/tiles/{z}/{x}/{y}.png'})
		}), vectorLayer
	    view: new ol.View({
		center: center,
		zoom: 13,
		maxZoom: 25



when I use the proxy, alas, I see weird horizontal white lines and I can’t figure out how to get rid of them:

No idea if this might cause the problem here, but I remember a case where a proxy replaced UNIX-Linfeed-Characters with Windows-Linfees&CarriageReturns. Even if either combinations of End-Of-Line should be ignored by the browser in my case it caused a 1 pixel gap between 2 rows of images.

thank you, this might be the case, but I don’t know how to find out if it really is… what kind of debug I am supposed to do here?

thank you in advance for your help!

I can add that the problem seems to disappear on higher zoom levels:

this problem is very annoying because I can’t figure out how to exactly identify it :frowning:

but in lower levels of zoom it looks even worse:

in some cases it looks like the tile is incomplete?

I’d try doing a “wget” or “curl” of a tile both with and without the proxy in place, and comparing the differences. You’ll need to make sure that the OSM tile is up to date (zooming in and get a fresh tile is the easiest way of doing that) and that your cache is up to date too.

An example tile in your area would be https://a.tile.openstreetmap.org/8/135/93.png , or at higher zoom https://a.tile.openstreetmap.org/19/278529/191106.png .

ok, it’s pretty weird but it turned out (thank you for suggesting CURL :slight_smile: it was the key for understanding!!!) that the problem was in the content-length header, I were calculating it this way:

header( 'Content-length: ' . filesize( $filename ) );

commenting this row solved the problem but… WTF? :smiley: