#I didn't buy cdn service, but it seems to be cached by cdn. It's too strange
35 messages · Page 1 of 1 (latest)
Are you using Cloudflare or Vercel? Caching on vercel is enable by default.
I deploy directly on my own cloud server, directly npm start, npm build🥹
what kind of cloud server? a bare-metal linux vm?
Could you share a link to the page? And screenshot of the response headers?
I am from Chinese Mainland and use Alibaba Cloud server
🥹
yes
13.1.6 /pages
How Can I disable directory and file cache policy through CDN?,:This topic describes how to disable the cache policy of a directory or file through CDN.
In the request header, x-nextjs-cache: HIT means that I still use cdn cache?🥹
no that is related to nextjs but there x-cache: HIT is
show the code for the / route
i meant the initial route /
I don't have the/route directory
is that right
do you have any dynamic data in there?
yes
try this
export async function getServerSideProps(context) {
context.res.setHeader(
'Cache-Control',
'public, s-maxage=10, stale-while-revalidate=59'
)
I just changed it to you, but it still doesn't work. Apart from dynamic data, I still haven't changed the static data in the head navigation. That is to say, the whole page is an old page, and the current change is not used
@kind iron You can see the latest content through IP access, and the old content through domain name access. IP access address: http://47.111.15.161:3000
that indicated a CDN has cached your stuff
the x-next-cache header might be cached too
in that case you need to clear the cache or disable it entirely on non-static directories
how to clear the cache🥹
I just logged in to the Alibaba Cloud background to check what the interface looks like if there are cdn settings. Can you give me a screenshot for reference? I can't find cdn in my resources, nor can I find any clues in the domain name resolution record
i have never used alibaba's cloud
Okay, thank you. Good night. Let's see if there's any inspiration, progress and so on tomorrow
This is what is looks like in cloudflare