Skip to content

Commit

Permalink
with Cache-Control: no-{cache,store}, bypass the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Jul 26, 2023
1 parent 705257f commit 72f7052
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const defaultConfig = {
healthCheck: null,
mapRouteParsers: (route, parsers) => parsers,
mapRouteOpenapiPaths: (route, openapiPaths) => openapiPaths,
addHafasOpts: () => {},
addHafasOpts: (opt, method, req) => {
if (['no-cache', 'no-store'].includes(req.headers['cache-control'])) {
opt[CACHED] = false
}
},
modifyRoutes: routes => routes,
}

Expand Down

0 comments on commit 72f7052

Please sign in to comment.