mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-05 06:07:48 +02:00
Problems with response speed have been fixed.
This commit is contained in:
@@ -238,7 +238,7 @@ class Server {
|
|||||||
public function isModified($filename) {
|
public function isModified($filename) {
|
||||||
$filename = $filename . '.mbtiles';
|
$filename = $filename . '.mbtiles';
|
||||||
$lastModifiedTime = filemtime($filename);
|
$lastModifiedTime = filemtime($filename);
|
||||||
$eTag = md5_file($filename);
|
$eTag = md5($lastModifiedTime);
|
||||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModifiedTime) . " GMT");
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModifiedTime) . " GMT");
|
||||||
header("Etag:" . $eTag);
|
header("Etag:" . $eTag);
|
||||||
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModifiedTime ||
|
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModifiedTime ||
|
||||||
@@ -261,6 +261,7 @@ class Server {
|
|||||||
if ($this->isDBLayer($tileset)) {
|
if ($this->isDBLayer($tileset)) {
|
||||||
if ($this->isModified($tileset) == TRUE) {
|
if ($this->isModified($tileset) == TRUE) {
|
||||||
header('HTTP/1.1 304 Not Modified');
|
header('HTTP/1.1 304 Not Modified');
|
||||||
|
die;
|
||||||
}
|
}
|
||||||
$this->DBconnect($tileset . '.mbtiles');
|
$this->DBconnect($tileset . '.mbtiles');
|
||||||
$z = floatval($z);
|
$z = floatval($z);
|
||||||
|
Reference in New Issue
Block a user