tiempo de cache

This commit is contained in:
humano 2020-04-28 15:53:01 -05:00
parent 0a5f6566e7
commit 32b0677668

View File

@ -285,7 +285,7 @@ if (!copy($geojson_original, $nuevo_fichero)) {
$geojson = "milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]"; $geojson = "milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]";
}else{ }else{
$nombre_geojson = "cache/".md5($_SERVER[QUERY_STRING]).".json"; $nombre_geojson = "cache/".md5($_SERVER[QUERY_STRING]).".json";
$cachetime = 1; $cachetime = 1800;
if (is_readable($nombre_geojson) && time() - $cachetime < filemtime($nombre_geojson) ) { if (is_readable($nombre_geojson) && time() - $cachetime < filemtime($nombre_geojson) ) {
$geojson= "$nombre_geojson"; $geojson= "$nombre_geojson";