From 858616f075e5a66a5e0973af421a9f300b3b9ce1 Mon Sep 17 00:00:00 2001 From: Inverle Date: Fri, 5 Sep 2025 08:16:52 +0200 Subject: Fixes for no-cache.txt (#7907) * Closes and fixes error from #7885 * `no-cache.txt` is now respected in `f.php`, `ext.php` and `serve` action in `extensionController` * And in all other places that weren't checking for `no-cache.txt` (some extensions maybe) --- p/api/query.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'p/api/query.php') diff --git a/p/api/query.php b/p/api/query.php index f7458e823..5d8fb3dec 100644 --- a/p/api/query.php +++ b/p/api/query.php @@ -48,17 +48,15 @@ if (!FreshRSS_Context::hasUserConf() || !FreshRSS_Context::userConf()->enabled) usleep(rand(20, 200)); } -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($dateLastModification ?: time(), 0, 0, false, PHP_COMPRESSION, false)) { - exit(); //No need to send anything - } +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 (!file_exists(DATA_PATH . '/no-cache.txt') && httpConditional($dateLastModification ?: time(), 0, 0, false, PHP_COMPRESSION, false)) { + exit(); //No need to send anything } Minz_Translate::init(FreshRSS_Context::userConf()->language); -- cgit v1.2.3