From 5e93e048ab83532f772c2ef0bfd2d141986341af Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 1 Feb 2022 17:07:32 +0530 Subject: [PATCH] Don't cache GET requests --- src/matrix/net/HomeServerApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/net/HomeServerApi.ts b/src/matrix/net/HomeServerApi.ts index a722da30..45e8a56c 100644 --- a/src/matrix/net/HomeServerApi.ts +++ b/src/matrix/net/HomeServerApi.ts @@ -77,7 +77,7 @@ export class HomeServerApi { timeout: options?.timeout, uploadProgress: options?.uploadProgress, format: "json", // response format - cache: options?.cache ?? false + cache: method !== "GET", }); const hsRequest = new HomeServerRequest(method, url, requestResult, options); @@ -160,7 +160,7 @@ export class HomeServerApi { // todo: This is so that we disable cache-buster because it would cause the hs to respond with error // see https://github.com/matrix-org/synapse/issues/7722 const _options = options ?? {}; - Object.assign(_options, { cache: true, allowedErrors: [401] }); + Object.assign(_options, { allowedErrors: [401] }); const body = { auth, password,