#Vercel Cache
1 messages · Page 1 of 1 (latest)
Hi @eager nest. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, Vercel's Edge Network does cache 301 redirect responses returned from Edge Middleware. According to the Vercel documentation (https://vercel.com/docs/edge-network/caching), for server responses to be successfully cached with Vercel's Edge Network, the response must use a 200, 404, 301, or 308 status code.
However, there are several other criteria that must also be met for a response to be cacheable:
- The request uses the
GETorHEADmethod. - The request does not contain a
RangeorAuthorizationheader. - The response does not exceed
10MBin content length. - The response does not contain the
set-cookieheader. - The response does not contain the
private,no-cacheorno-storedirectives in theCache-Controlheader.
As long as your 301 responses meet these criteria and have a Cache-Control header set to public with s-maxage=86400, they should be cached by Vercel's Edge Network.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@eager nest kapa.ai is still learning and improving, please let us know how it did by reacting below