Gate analytics and cache public API requests

This commit is contained in:
2569718930@qq.com
2026-04-06 13:58:11 +08:00
parent 9be12ad1d7
commit 08d7308486
14 changed files with 114 additions and 309 deletions
+8 -3
View File
@@ -18,10 +18,15 @@ export async function GET(req: NextRequest) {
}
try {
const auth = await buildBackendRequestHeaders(req);
const res = await fetch(`${API_BASE}/api/cities`, {
const auth = await buildBackendRequestHeaders(req, {
includeSupabaseIdentity: false,
});
const fetchOptions = {
headers: auth.headers,
cache: "no-store",
next: { revalidate: 300 },
} as const;
const res = await fetch(`${API_BASE}/api/cities`, {
...fetchOptions,
});
if (!res.ok) {
const raw = await res.text();