From a46879f1cba0973367d78f0cf549168888e5595d Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 5 Sep 2023 18:29:11 +0300 Subject: [PATCH 1/3] cache key reformat --- app/controllers/shared/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 9dd800b69b..b65e35e605 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -203,7 +203,7 @@ App::init() $useCache = $route->getLabel('cache', false); if ($useCache) { - $key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER; + $key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER); $cache = new Cache( new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) ); @@ -491,7 +491,7 @@ App::shutdown() $resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user); } - $key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER; + $key = md5($request->getURI() . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER); $data = json_encode([ 'resourceType' => $resourceType, 'resource' => $resource, From f246d4d6e5c52c3ecc2a627f8dfc5e42806af194 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 5 Sep 2023 21:21:24 +0300 Subject: [PATCH 2/3] removed $route->setIsActive(false); from cache output --- app/controllers/shared/api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index b65e35e605..13db405091 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -255,7 +255,6 @@ App::init() ->send(base64_decode($data['payload'])) ; - $route->setIsActive(false); } else { $response->addHeader('X-Appwrite-Cache', 'miss'); } From c30fa277d3eae6148b4a1c6e2f5ef39a4375a1b5 Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 13 Sep 2023 10:24:36 +0300 Subject: [PATCH 3/3] linter fix --- app/controllers/shared/api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 13db405091..c2102057fa 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -254,7 +254,6 @@ App::init() ->setContentType($data['contentType']) ->send(base64_decode($data['payload'])) ; - } else { $response->addHeader('X-Appwrite-Cache', 'miss'); }