mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
cache-control (#423)
Change CACHE_MAX_AGE to CACHE_CONTROL in AWS and Cloudflare
This commit is contained in:
@@ -15,7 +15,7 @@ interface Env {
|
||||
// biome-ignore lint: config name
|
||||
BUCKET: R2Bucket;
|
||||
// biome-ignore lint: config name
|
||||
CACHE_MAX_AGE?: number;
|
||||
CACHE_CONTROL?: string;
|
||||
// biome-ignore lint: config name
|
||||
PMTILES_PATH?: string;
|
||||
// biome-ignore lint: config name
|
||||
@@ -134,8 +134,9 @@ export default {
|
||||
) => {
|
||||
cacheableHeaders.set(
|
||||
"Cache-Control",
|
||||
`max-age=${env.CACHE_MAX_AGE || 86400}`
|
||||
env.CACHE_CONTROL || "public, max-age=86400"
|
||||
);
|
||||
|
||||
const cacheable = new Response(body, {
|
||||
headers: cacheableHeaders,
|
||||
status: status,
|
||||
|
||||
@@ -9,4 +9,4 @@ r2_buckets = [
|
||||
|
||||
[vars]
|
||||
# ALLOWED_ORIGINS = "http://localhost:8000"
|
||||
# CACHE_MAX_AGE = 86400
|
||||
# CACHE_CONTROL = "public, max-age=86400"
|
||||
Reference in New Issue
Block a user