refactor: move cache headers logic into reusable functions (#4533)

* refactor: move cache headers logic into reusable functions

* dev

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Alexandr GarbuzovandAlexandr authored and GitHub committed 2025-10-07 00:13:21 +03:00
1 parent ade7d53653
commit 09627ce715
10 files changed
+100 -94

No files matched your search

+3 -3
View File
@@ -230,9 +230,9 @@ describe("Test /api/top-langs", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.setHeader).toBeCalledWith(
"Cache-Control",
`max-age=${CONSTANTS.TOP_LANGS_CACHE_SECONDS / 2}, s-maxage=${
CONSTANTS.TOP_LANGS_CACHE_SECONDS
}`,
`max-age=${CONSTANTS.TOP_LANGS_CACHE_SECONDS}, ` +
`s-maxage=${CONSTANTS.TOP_LANGS_CACHE_SECONDS}, ` +
`stale-while-revalidate=${CONSTANTS.ONE_DAY}`,
);
});
});