Disable cache-control in dev mode

This commit is contained in:
DrMint 2024-07-07 01:56:25 +02:00
parent f6e791a7ac
commit 465e0612ff
3 changed files with 8 additions and 3 deletions

View File

@ -13,6 +13,7 @@ DATA_CACHING=false
DATA_PRECACHING=false DATA_PRECACHING=false
PAGE_CACHING=false PAGE_CACHING=false
PAGE_PRECACHING=false PAGE_PRECACHING=false
CACHE_CONTROL=false
## OPEN EXCHANGE RATE ## OPEN EXCHANGE RATE
OER_APP_ID=oerappid5e6ea45ef4e66eaa151612bdcb599df OER_APP_ID=oerappid5e6ea45ef4e66eaa151612bdcb599df

View File

@ -2,8 +2,7 @@
## Ongoing ## Ongoing
- [Bugs] No post processing on the 404 page - [Bugs] It's possible to save a page with empty Line or Cue
- [Bugs] Keziah reported some lag spikes when scrolling on the home page (Firefox on Windows) - [Bugs] Keziah reported some lag spikes when scrolling on the home page (Firefox on Windows)
- [Feat] [Analytics] Add analytics - [Feat] [Analytics] Add analytics
- [Bugs] [Tooltips] Tooltip in under next element (example in timeline) - [Bugs] [Tooltips] Tooltip in under next element (example in timeline)

View File

@ -12,7 +12,12 @@ export const addCommonHeadersMiddleware = defineMiddleware(async ({ url }, next)
// TODO: Remove when in production // TODO: Remove when in production
response.headers.set("X-Robots-Tag", "none"); response.headers.set("X-Robots-Tag", "none");
response.headers.set("Vary", "Cookie"); response.headers.set("Vary", "Cookie");
if (import.meta.env.CACHE_CONTROL !== "true") {
response.headers.set("Cache-Control", "no-store");
} else {
response.headers.set("Cache-Control", "max-age=86400, stale-while-revalidate=86400"); response.headers.set("Cache-Control", "max-age=86400, stale-while-revalidate=86400");
}
return response; return response;
}); });