From d2a2caedbdcebba6216240b69c0b6778dd1ff8de Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 12 Jun 2024 18:42:04 +0300 Subject: [PATCH 1/3] Update Expires header via cache shared api --- app/controllers/shared/api.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index bb9408e692c..ed654c2abb1 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -457,13 +457,16 @@ } $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $timestamp) . ' GMT') ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')) ->send($data); } else { $response->addHeader('X-Appwrite-Cache', 'miss'); } + $response + ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->addHeader('Pragma', 'no-cache') + ->addHeader('Expires', 0); } }); From 3f42b03f8e9a202ff12f87c96c3c880916c63075 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 13 Jun 2024 09:40:03 +0300 Subject: [PATCH 2/3] Update Expires header via cache shared api --- app/controllers/shared/api.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index ed654c2abb1..1d76f2c2a93 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -457,16 +457,18 @@ } $response + ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $timestamp) . ' GMT') ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')) ->send($data); } else { - $response->addHeader('X-Appwrite-Cache', 'miss'); + $response + ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->addHeader('Pragma', 'no-cache') + ->addHeader('Expires', 0) + ->ddHeader('X-Appwrite-Cache', 'miss') + ; } - $response - ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') - ->addHeader('Pragma', 'no-cache') - ->addHeader('Expires', 0); } }); From 4bedb2f52a4b797791ba58aac5689281629d1060 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 13 Jun 2024 09:40:36 +0300 Subject: [PATCH 3/3] Update Expires header via cache shared api --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 1d76f2c2a93..2b0013db291 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -466,7 +466,7 @@ ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') ->addHeader('Expires', 0) - ->ddHeader('X-Appwrite-Cache', 'miss') + ->addHeader('X-Appwrite-Cache', 'miss') ; } }