1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 09:25:22 -04:00

set x-vercel-enable-rewrite-caching header

This commit is contained in:
Jake Jarvis 2025-04-11 16:33:17 -04:00
parent 3325ef9242
commit 34dd3788fc
Signed by: jake
SSH Key Fingerprint: SHA256:nCkvAjYA6XaSPUqc4TfbBQTpzr8Xj7ritg/sGInCdkc

View File

@ -74,7 +74,7 @@ const nextConfig: NextConfig = {
headers: [ headers: [
{ {
key: "strict-transport-security", key: "strict-transport-security",
value: "max-age=63072000; includeSubDomains; preload", value: "max-age=63072000",
}, },
{ {
// 🥛 debugging // 🥛 debugging
@ -83,6 +83,33 @@ const nextConfig: NextConfig = {
}, },
], ],
}, },
{
source: "/_stream/(.*)",
headers: [
{
// https://vercel.com/docs/rewrites#caching-rewrites
key: "x-vercel-enable-rewrite-caching",
value: "1",
},
],
},
...(process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID
? [
{
source: "/_stream/u/api/send",
headers: [
{
key: "cache-control",
value: "no-cache, no-store",
},
{
key: "x-vercel-enable-rewrite-caching",
value: "0",
},
],
},
]
: []),
...(process.env.NEXT_PUBLIC_ONION_DOMAIN ...(process.env.NEXT_PUBLIC_ONION_DOMAIN
? [ ? [
{ {
@ -99,15 +126,6 @@ const nextConfig: NextConfig = {
}, },
] ]
: []), : []),
{
source: "/tweets(|/.*)",
headers: [
{
key: "x-robots-tag",
value: "noindex, nofollow, nosnippet",
},
],
},
], ],
rewrites: async () => [ rewrites: async () => [
...(process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID ...(process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID
@ -124,11 +142,6 @@ const nextConfig: NextConfig = {
source: "/tweets/:path*", source: "/tweets/:path*",
destination: "https://tweets-khaki.vercel.app/:path*", destination: "https://tweets-khaki.vercel.app/:path*",
}, },
{
source: "/pubkey.asc",
destination:
"https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x3bc6e5776bf379d36f6714802b0c9cf251e69a39",
},
], ],
redirects: async () => [ redirects: async () => [
{ source: "/y2k", destination: "https://y2k.pages.dev", permanent: false }, { source: "/y2k", destination: "https://y2k.pages.dev", permanent: false },
@ -137,6 +150,12 @@ const nextConfig: NextConfig = {
destination: "https://umami-wine-eight.vercel.app/share/wwTaTpLgC6gP9VyX/jarv.is", destination: "https://umami-wine-eight.vercel.app/share/wwTaTpLgC6gP9VyX/jarv.is",
permanent: false, permanent: false,
}, },
{
source: "/pubkey.asc",
destination:
"https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x3bc6e5776bf379d36f6714802b0c9cf251e69a39",
permanent: false,
},
// NOTE: don't remove this, it ensures de-AMPing the site hasn't offended our google overlords too badly! // NOTE: don't remove this, it ensures de-AMPing the site hasn't offended our google overlords too badly!
// https://developers.google.com/search/docs/advanced/experience/remove-amp#remove-only-amp // https://developers.google.com/search/docs/advanced/experience/remove-amp#remove-only-amp