infostreams / mbtiles-php

PHP backend for reading tiles from mbtiles databases
MIT License
125 stars 34 forks source link

Caching spec violations #11

Closed aidanhs closed 10 years ago

aidanhs commented 10 years ago

First off, I've not actually run the PHP script, I've just been converting it to python (at aidanhs/mbtiles-py). I noticed two caching issues:

header("Expires: " . gmdate('D, d M Y H:i:s', time()+$expires))

Per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 I think this needs the GMT part on it.

    protected function etag($type) {                                            
        return sha1(sprintf("%s-%s-%s-%s-%s-%s", $this->tileset, $this->x, $this->y, $this->z, $type, filemtime($this->getMBTilesName())));
    }

ETag values should be surrounded by double quotes.

infostreams commented 10 years ago

Awesome, thanks! I've include a fix for those. I've had a look at the Python version and it's really weird to see my own code in a different language :-) Thanks! Please let me know if you run into any other issues.