MCPcopy Index your code
hub / github.com/BrasilAPI/BrasilAPI / cache

Function cache

middlewares/cache.js:18–24  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

16// stale/out-of-date cache caso alterássemos a implementação da API.
17
18const cache = (time) => (request, response, next) => {
19 const CACHE_CONTROL_HEADER_VALUE = `max-age=0, s-maxage=${time}, stale-while-revalidate, public`;
20
21 response.setHeader('Cache-Control', CACHE_CONTROL_HEADER_VALUE);
22
23 next();
24};
25
26export default cache;

Callers 1

appFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected