cache para mapero

This commit is contained in:
humano 2020-04-28 15:31:16 -05:00
parent e25e18eb5e
commit e13e076e69
6 changed files with 30 additions and 56968 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ upload/
milfs/includes/datos.php
.gitmodules
librerias/calendar/demos/
cache/

5350
cache/geojson_1038.json vendored

File diff suppressed because it is too large Load Diff

41444
cache/geojson_1045.json vendored

File diff suppressed because it is too large Load Diff

10168
cache/geojson_74.json vendored

File diff suppressed because it is too large Load Diff

0
cache/index.php vendored
View File

View File

@ -273,10 +273,33 @@ print $css_adicional;
<script src="./librerias/bootstrap/js/bootstrap.min.js" ></script>
<!-- <script src="librerias/jquery/jquery-2.1.4.min.js"></script> -->
<?php $cadena_busqueda = $_REQUEST['buscar'];
if(isset($_REQUEST['buscar'])){
$geojson = "milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]";
<?php
$cadena_busqueda = urlencode($_REQUEST['buscar']);
/*
if (!copy($geojson_original, $nuevo_fichero)) {
echo "Error al copiar $geojson_original ...\n";
}
*/
//if(isset($_REQUEST['buscar'])){
$nombre_geojson = "cache/".md5($_SERVER[QUERY_STRING]).".json";
$cachetime = 1;
if (is_readable($nombre_geojson) && time() - $cachetime < filemtime($nombre_geojson) ) {
$geojson= "$nombre_geojson";
}else{
include("milfs/includes/datos.php");
ob_start();
include ("$site"."milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]");
$cache = ob_get_contents();
ob_end_clean();
$nuevo_fichero = "cache/".md5($_SERVER[QUERY_STRING]).".json";
$fp = fopen("$nuevo_fichero", 'w');
fwrite($fp, "$cache");
fclose($fp);
$geojson = "milfs/geojson.js.php?id=$_REQUEST[id]&buscar=$cadena_busqueda&item=$_REQUEST[item]";
}
/* }else{
$nombre_geojson = "cache/geojson_$_REQUEST[id].json";
if (is_readable($nombre_geojson)) {
$geojson= "$nombre_geojson";
@ -285,7 +308,7 @@ print $css_adicional;
}
//$geojson ="geojsoncaen.js.php";
}
*/
?>
<script type="text/javascript" src="<?php echo $geojson; ?>"></script>