From df758f40efdeb271d1e9086644ffba6b8fd10055 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Wed, 9 Sep 2020 11:11:52 +0200 Subject: Avoid photo profile fetching more than once every 1 min --- include/photo/photo_driver.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/photo') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 495008a22..79d4e10bf 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -238,6 +238,8 @@ function import_xchan_photo($photo, $xchan, $thing = false, $force = false) { if(array_key_exists('expires', $hdrs)) $expires = strtotime($hdrs['expires']); + if($expires - 60 < time()) + $expires = time() + 60; else { $cc = ''; if(array_key_exists('cache-control', $hdrs)) -- cgit v1.2.3