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:
1 parent
ade7d53653
commit
09627ce715
10 files changed
+100
-94
No files matched your search
@@ -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}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user