Hi 👋 , I am confused about vercel edge cache. I am making request to API route which is edge runtime and it fetches the remote audio segment file and I set CDN cache in API route. Below is my API route.
import { type NextRequest, NextResponse } from "next/server";
export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
const query: string | null = searchParams.get("with");
if (query) {
console.log(query);
const fetchData = await fetch(query, {
priority: "high",
headers: {
"Cache-Control": "public, max-age=31536000, immutable",
},
});
const response = new NextResponse(await fetchData.arrayBuffer(), {
status: fetchData.status,
headers: fetchData.headers,
});
response.headers.set(
"Cache-Control",
"public,max-age=31536000,smax-age=31536000"
);
response.headers.set(
"CDN-Cache-Control",
"public,max-age=360000,smax-age=360000"
);
return response
}
return NextResponse.json(
{ error: "Query parameter 'with' is missing" },
{ status: 400 }
);
}
And the response after first request is included
x-vervel-cache : HIT```
My question is that is there any way to change cloudflare cache status dynamic to miss or hit as dynamic means it doesn't consider to be cache although my audio segment file are static and even vercel can cache it.
I am sorry if I misunderstood something in this content. Please answer me.