com web/people: cache fetches for 1 day instead of 1 week: include/misc.php
| From: | Peter Cowburn | Date: | Thu, 16 May 2019 15:24:36 +0000 |
| Subject: | com web/people: cache fetches for 1 day instead of 1 week: include/misc.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-28106@lists.php.net to get a copy of this message | ||
Commit: f421358a65a1c424d0e21970171721c806f524a7
Author: Peter Cowburn <pcowburn@akamai.com> Thu, 16 May 2019 16:24:36 +0100
Parents: 665bef3b9af6a0f3182bb9a819975d5357fb5400
Branches: master
Link: http://git.php.net/?p=web/people.git;a=commitdiff;h=f421358a65a1c424d0e21970171721c806f524a7
Log:
cache fetches for 1 day instead of 1 week
Changed paths:
M include/misc.php
Diff:
diff --git a/include/misc.php b/include/misc.php
index 340dffc..36cfa71 100644
--- a/include/misc.php
+++ b/include/misc.php
@@ -67,7 +67,7 @@ function cached($url, $options = false, $ctx = null)
$user = sha1($url);
$tmpfile = $tmpdir . "/" . $user;
- if (file_exists($tmpfile) && filemtime($tmpfile) > strtotime("-1 week")) {
+ if (file_exists($tmpfile) && filemtime($tmpfile) > strtotime("-1 day")) {
return file_get_contents($tmpfile);
}
$content = file_get_contents($url, $options, $ctx);