Update webpagetool.php

This commit is contained in:
Namhyeon Go 2019-11-14 14:05:49 +09:00 committed by GitHub
parent 46c9d3d836
commit d49894dd4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -480,6 +480,8 @@ if(!check_function_exists("get_web_identifier")) {
$checksums[] = $checksum_header;
}
//write_common_log(json_encode($checksums), "get_web_identifier");
return get_hashed_text(implode(".", $checksums));
}
}
@ -499,12 +501,15 @@ if(!check_function_exists("get_web_cache")) {
$identifier = get_web_identifier($url, $method, $data);
$gz_content = read_storage_file($identifier, array(
"storage_type" => "cache",
"max_age" => $cache_max_age
//"max_age" => $cache_max_age
));
if($gz_content !== false) {
$content = gzinflate($gz_content);
$cache_hits++;
write_common_log(sprintf("Cache hit. %s, %s, %s", $identifier, strlen($content), strlen($gz_content)), "helper/webpagetool");
} else {
write_common_log(sprintf("Cache no hit. %s", $identifer), "helper/webpagetool");
}
}