Skip to content

Commit

Permalink
Merge branch 'trs/caching'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsibley committed Jan 18, 2024
2 parents 1cc7bfe + bdac614 commit 5833ee3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/upstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ async function proxyResponseBodyFromUpstream(req, res, upstreamReq) {

res.set(copyHeaders(upstreamRes.headers, forwardedUpstreamResHeaders));

/* Allow private (e.g. browser) caches to store this response, but require
* them to revalidate it every time before use. They'll make conditional
* requests which we can respond to quickly from our own server-side cache.
*/
res.set("Cache-Control", "private, no-cache");

/* Check if the request conditions (e.g. If-None-Match) are satisfied (e.g.
* against our response ETag) and short-circuit with a 304 if we can!
*/
Expand Down

0 comments on commit 5833ee3

Please sign in to comment.