aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-08-19 19:10:54 +0200
committerGravatar GitHub <noreply@github.com> 2024-08-19 19:10:54 +0200
commit673b5309ea846cae8586a492ef57ee5de632f2b8 (patch)
tree6d4ee6132efec906a5d52a8410e399c890f35601 /lib
parentb49780b714006d8063e174a18c336266d5ec5fa3 (diff)
Fix HTTP cache for modified time when content is not modified (#6723)
Fix case when server is sending a new modified time while the content was not actually modified. fix https://github.com/FreshRSS/FreshRSS/issues/6712
Diffstat (limited to 'lib')
-rw-r--r--lib/SimplePie/SimplePie.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php
index 25dcc7fad..200918314 100644
--- a/lib/SimplePie/SimplePie.php
+++ b/lib/SimplePie/SimplePie.php
@@ -1728,11 +1728,17 @@ class SimplePie
$md5 = $this->cleanMd5($file->body);
if ($this->data['md5'] === $md5) {
+ // FreshRSS
if ($this->syslog_enabled)
{
syslog(LOG_DEBUG, 'SimplePie MD5 cache match for ' . SimplePie_Misc::url_remove_credentials($this->feed_url));
}
- $cache->touch();
+ $this->data['headers'] = $file->headers;
+ $this->data['mtime'] = time();
+ if (!$cache->save($this))
+ {
+ trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ }
return true; //Content unchanged even though server did not send a 304
} else {
if ($this->syslog_enabled)