Open korywka opened 5 years ago
What type of requests do you have in mind?
The rasterized tiles and fonts have Last-Modified
that should update in case of SIGHUP
. The raw data (e.g. .pbf tiles from .mbtiles) have Last-Modified
based on the last modification of the .mbtiles file, which I believe is a correct behavior.
*.mbtiles
:
Request to docker container: 14:30:24 GMT
curl --head localhost:8080/data/buildings/14/9569/5517.pbf
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/x-protobuf
Content-Encoding: gzip
Last-Modified: Wed, 24 Apr 2019 14:30:24 GMT
Content-Length: 148
ETag: W/"94-gchvqzo1EaX4rE/cW69nfX45DYI"
Date: Wed, 24 Apr 2019 16:32:57 GMT
Connection: keep-alive
File stats: 16:30:24 GMT
stat ./data/upload/buildings.mbtiles
File: ./data/upload/buildings.mbtiles
Size: 1171456 Blocks: 2288 IO Block: 4096 regular file
Device: 801h/2049d Inode: 922042 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1001/ tile) Gid: ( 1002/ tile)
Access: 2019-04-24 16:30:24.625221481 +0000
Modify: 2019-04-24 16:30:24.573217182 +0000
Change: 2019-04-24 16:30:24.573217182 +0000
But after docker restart ...
it really shows correct date 16:30:24 GMT:
curl --head localhost:8080/data/buildings/14/9569/5517.pbf
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/x-protobuf
Content-Encoding: gzip
Last-Modified: Wed, 24 Apr 2019 16:30:24 GMT
Content-Length: 148
ETag: W/"94-gchvqzo1EaX4rE/cW69nfX45DYI"
Date: Wed, 24 Apr 2019 16:38:21 GMT
Connection: keep-alive
The SIGHUP signal doesn't seem to be intercepted at all by tileserver-gl. I'd start the server with docker: docker run --rm -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl -c config.json --verbose
Then I'd add/remove some styles from config.json
Next run:
docker kill --signal=SIGHUP ad038a6c9eaf
(# where ad038a6c9eaf is the containerId) but nothing happens. New styles are not added and nothing is logged into tileserver-gl terminal which makes think the signal is not going through. Is there anything I'm doing wrong?
PS: I tried both the official docker hub tileserver-gl v2.5.0 and a locally built image (v3.0.0) with same behaviours.
If you are using
docker kill --signal=SIGHUP ${containerId}
, it is better to remove this header by nginx:add_header Last-Modified "";
. In spite of this header is weak for cache control (according to articles), I think it should be updated.