aboutsummaryrefslogtreecommitdiff
path: root/p/api
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-08-16 22:40:56 +0200
committerGravatar GitHub <noreply@github.com> 2024-08-16 22:40:56 +0200
commitc480e571619c2e68000d85b866ef23c89ad83ddf (patch)
tree00fb41a714775cd111eb0d72161e691a81520284 /p/api
parent1fad724b951d1f804be03362a855f9d50ab4acc9 (diff)
Fix HTTP cache of user queries (#6718)
fix https://github.com/FreshRSS/FreshRSS/issues/6717
Diffstat (limited to 'p/api')
-rw-r--r--p/api/query.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/p/api/query.php b/p/api/query.php
index fff48503e..57ec10ff3 100644
--- a/p/api/query.php
+++ b/p/api/query.php
@@ -47,8 +47,13 @@ if (!FreshRSS_Context::hasUserConf() || !FreshRSS_Context::userConf()->enabled)
if (!file_exists(DATA_PATH . '/no-cache.txt')) {
require(LIB_PATH . '/http-conditional.php');
+ $dateLastModification = max(
+ FreshRSS_UserDAO::ctime($user),
+ FreshRSS_UserDAO::mtime($user),
+ @filemtime(DATA_PATH . '/config.php') ?: 0
+ );
// TODO: Consider taking advantage of $feedMode, only for monotonous queries {all, categories, feeds} and not dynamic ones {read/unread, favourites, user labels}
- if (httpConditional(FreshRSS_UserDAO::mtime($user) ?: time(), 0, 0, false, PHP_COMPRESSION, false)) {
+ if (httpConditional($dateLastModification ?: time(), 0, 0, false, PHP_COMPRESSION, false)) {
exit(); //No need to send anything
}
}