0

I have been getting a few strange responses from the http server for the tile date. I guestimate this issue to be present about 2% of the time.

When I request a tile I get a valid response on the socket like this:

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 27 Feb 2020 08:44:13 GMT
Content-Type: image/png
Content-Length: 8966
Connection: keep-alive
Keep-Alive: timeout=20
Expect-CT: max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"
ETag: \"15cf3221a855106d1bb253ddfa9959d5\"
Cache-Control: max-age=59888, stale-while-revalidate=604800, stale-if-error=604800
Expires: Fri, 28 Feb 2020 01:22:20 GMT
Access-Control-Allow-Origin: *
X-TileRender: bowser.openstreetmap.org
X-Cache: MISS from longma.openstreetmap.org
X-Cache-Lookup: MISS from longma.openstreetmap.org:3128
Via: 1.1 longma.openstreetmap.org (squid/4.9)
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Note that the Content-Length is announced to be 8966 bytes. In the next read on the socket I receive more data that was announced from the server. If I examine the extra data after the end of the border as announced in Content-Length I get another (valid?) response for the same map tile appended at the end of the data. Headers are slightly different but since the second Content-Length is identical I assume something has gone wrong with caching and that perhaps the cache has appended its response to the original server response:

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 27 Feb 2020 08:44:13 GMT
Content-Type: image/png
Content-Length: 8966
Connection: keep-alive
Keep-Alive: timeout=20
Expect-CT: max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"
ETag: \"15cf3221a855106d1bb253ddfa9959d5\"
Cache-Control: max-age=65773, stale-while-revalidate=604800, stale-if-error=604800
Expires: Fri, 28 Feb 2020 02:19:39 GMT
Access-Control-Allow-Origin: *
X-TileRender: odin.openstreetmap.org
Age: 2447
X-Cache: HIT from takhisis.openstreetmap.org
X-Cache-Lookup: HIT from takhisis.openstreetmap.org:3128
Via: 1.1 takhisis.openstreetmap.org (squid/4.10)
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

The second chunk of data seems to indicate that this was a Cache HIT vs. the initial response that announced a MISS.

I will stress again that this data was received in sequence, on the same socket, for one single request. So request for: http://a.tile.openstreetmap.org/18/135565/89323.png, resolved a.tile.openstreetmap.org to 31.3.110.20. Then I wait for a response, get headers as seen in the first header block above, receive a valid PNG image but then the TCP stream simply contains more data beyond the expected end of the PNG data - a new headers and another (I assume valid) PNG data block.

If I am not mistaken this is highly unusual and violates the HTTP protocol.

So my question is: Is this "normal" and I simply don't understand a part of the HTTP protocol specification or is this a bad response from the OSM servers?

If it is indeed a bad response it would probably make sense to look why this behaviour occurs.

asked 27 Feb, 09:45

AlesO's gravatar image

AlesO
11113
accept rate: 0%

edited 27 Feb, 19:07

2

I'd remove your final paragraph - best stick to one thing at a time!

(27 Feb, 11:28) Andy Allan

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×243
×175
×7
×7

question asked: 27 Feb, 09:45

question was seen: 491 times

last updated: 27 Feb, 19:07

powered by OSQA