Commit 97b7f387eda26f629dee21dfe23ab65cb3502c83
1 parent
ef50833a
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
11 additions
and
9 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/mapa_openlayers.php
| @@ -133,8 +133,6 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alter | @@ -133,8 +133,6 @@ if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alter | ||
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | } | 135 | } |
| 136 | -//if($qy || $_GET["HEIGHT"] != 256 ) | ||
| 137 | -//{$cache = false;} | ||
| 138 | if($_GET["layer"] == "") | 136 | if($_GET["layer"] == "") |
| 139 | {$cache = true;} | 137 | {$cache = true;} |
| 140 | if($_GET == false) | 138 | if($_GET == false) |
| @@ -143,6 +141,8 @@ if(strtolower($_GET["DESLIGACACHE"]) == "sim") | @@ -143,6 +141,8 @@ if(strtolower($_GET["DESLIGACACHE"]) == "sim") | ||
| 143 | {$cache = false;} | 141 | {$cache = false;} |
| 144 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") | 142 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
| 145 | {$cache = false;} | 143 | {$cache = false;} |
| 144 | +if($qy) | ||
| 145 | +{$cache = false;} | ||
| 146 | if($cache == true) | 146 | if($cache == true) |
| 147 | {carregaCacheImagem($cachedir,$_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} | 147 | {carregaCacheImagem($cachedir,$_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} |
| 148 | 148 | ||
| @@ -234,6 +234,7 @@ else | @@ -234,6 +234,7 @@ else | ||
| 234 | } | 234 | } |
| 235 | $l->close(); | 235 | $l->close(); |
| 236 | } | 236 | } |
| 237 | + $cache = false; | ||
| 237 | } | 238 | } |
| 238 | if (!function_exists('imagepng')) | 239 | if (!function_exists('imagepng')) |
| 239 | { | 240 | { |
| @@ -244,7 +245,6 @@ if (!function_exists('imagepng')) | @@ -244,7 +245,6 @@ if (!function_exists('imagepng')) | ||
| 244 | if (!function_exists('imagepng')) | 245 | if (!function_exists('imagepng')) |
| 245 | {$_GET["TIPOIMAGEM"] = "";} | 246 | {$_GET["TIPOIMAGEM"] = "";} |
| 246 | } | 247 | } |
| 247 | - | ||
| 248 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") | 248 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
| 249 | { | 249 | { |
| 250 | if($img->imagepath == "") | 250 | if($img->imagepath == "") |
| @@ -271,11 +271,13 @@ else{ | @@ -271,11 +271,13 @@ else{ | ||
| 271 | } | 271 | } |
| 272 | header('Content-Length: '.filesize($nomer)); | 272 | header('Content-Length: '.filesize($nomer)); |
| 273 | header('Content-Type: image/png'); | 273 | header('Content-Type: image/png'); |
| 274 | - //header('Cache-Control: max-age=3600, must-revalidate'); | ||
| 275 | - header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
| 276 | - header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | ||
| 277 | - $etag = md5_file($nomer); | ||
| 278 | - header('Etag: '.$etag); | 274 | + if($cache == true){ |
| 275 | + header('Cache-Control: max-age=3600, must-revalidate'); | ||
| 276 | + header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
| 277 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | ||
| 278 | + $etag = md5_file($nomer); | ||
| 279 | + header('Etag: '.$etag); | ||
| 280 | + } | ||
| 279 | fpassthru(fopen($nomer, 'rb')); | 281 | fpassthru(fopen($nomer, 'rb')); |
| 280 | exit; | 282 | exit; |
| 281 | } | 283 | } |
| @@ -334,7 +336,7 @@ function carregaCacheImagem($cachedir,$bbox,$layer,$map,$w,$h){ | @@ -334,7 +336,7 @@ function carregaCacheImagem($cachedir,$bbox,$layer,$map,$w,$h){ | ||
| 334 | */ | 336 | */ |
| 335 | header('Content-Length: '.filesize($nome)); | 337 | header('Content-Length: '.filesize($nome)); |
| 336 | header('Content-Type: image/png'); | 338 | header('Content-Type: image/png'); |
| 337 | - //header('Cache-Control: max-age=3600, must-revalidate'); | 339 | + header('Cache-Control: max-age=3600, must-revalidate'); |
| 338 | header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | 340 | header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); |
| 339 | header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nome)).' GMT', true, 200); | 341 | header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nome)).' GMT', true, 200); |
| 340 | $etag = md5_file($nome); | 342 | $etag = md5_file($nome); |