DNS Cache Error
Unanswered
Mostlyk posted this in #help-forum
MostlykOP
Hey so we have a domain, and we hosted a next site using vercel on that domain , ( we bought the domain from godaddy). And now because a lot of our users have already visited that site, we have deployed a new site and the users still see the old site. We can't ask everyone to clear cache on their devices. What can we do here?
116 Replies
MostlykOP
and yes we already have added:
async headers() {
return [
{
source: "/",
headers: [
{
key: "Cache-Control",
value: "no-cache, no-store, must-revalidate",
},
{
key: "Pragma",
value: "no-cache",
},
{
key: "Expires",
value: "0",
},
],
},
{
source: "/_next/static/(.*)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
];
},
@Mostlyk Hey so we have a domain, and we hosted a next site using vercel on that domain , ( we bought the domain from godaddy). And now because a lot of our users have already visited that site, we have deployed a new site and the users still see the old site. We can't ask everyone to clear cache on their devices. What can we do here?
depending on where you are configuring your DNS you can see there the
TTL
. That says how long it's inside the DNS cache in minutes. So set it low and your DNS won't be the problem anymore@B33fb0n3 depending on where you are configuring your DNS you can see there the TTL. That says how long it's inside the DNS cache in minutes. So set it low and your DNS won't be the problem anymore
MostlykOP
yeah that's 1 hour on everything, we have deployed the site 3-4 days ago and it's still persistent, the users still see the old CSS,HTML
@Mostlyk yeah that's 1 hour on everything, we have deployed the site 3-4 days ago and it's still persistent, the users still see the old CSS,HTML
can you share your page? Like your domain
cached view
how it's supposed to look
I have kept cache on this browser for me to check
@B33fb0n3 did you redeployed your app on vercel? I getting a cache hit from vercel
MostlykOP
yeah? like it was initially deployed on vercel from a different account on a different repo

and the number for
stale time
is at 4294967294
. For vercel that's an infinite time of cache:MostlykOP
hmmm so how do I make changes?
Should your page be static?
MostlykOP
wait so you haven't even visited the prev site, are you able to see it?
@B33fb0n3 Should your page be static?
MostlykOP
preferably no
MostlykOP
every page is static except /profile
@B33fb0n3 I see this one
MostlykOP
yeah this is the new one
this we are fine with vercel storing cache
@Mostlyk preferably no
then add the following on top of your page:
export const dynamic = 'force-dynamic';
export const revalidate = true;
@B33fb0n3 then add the following on top of your page:
tsx
export const dynamic = 'force-dynamic';
export const revalidate = true;
MostlykOP
revalidate = 60 is what I kept, gonna check now , thanks for the help!
it's building
π€
Also do you know a better way to save 100 Gb bandwidth vercel offers?
We had issues last time as it finished relativitly quickly
We had issues last time as it finished relativitly quickly
@B33fb0n3 then add the following on top of your page:
tsx
export const dynamic = 'force-dynamic';
export const revalidate = true;
MostlykOP
btw issue still persists after this. Current deployment has this :(
@Mostlyk Also do you know a better way to save 100 Gb bandwidth vercel offers?
We had issues last time as it finished relativitly quickly
let's focus on this issue first. Remind me at the end of this thread about that
@Mostlyk btw issue still persists after this. Current deployment has this :(
it looks like it's still not dynamic yet: (see attached).
Can you remove your header overwrites, so we can check easier why the error persists?
Can you remove your header overwrites, so we can check easier why the error persists?
@Mostlyk and yes we already have added:
ts
async headers() {
return [
{
source: "/",
headers: [
{
key: "Cache-Control",
value: "no-cache, no-store, must-revalidate",
},
{
key: "Pragma",
value: "no-cache",
},
{
key: "Expires",
value: "0",
},
],
},
{
source: "/_next/static/(.*)",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
];
},
MostlykOP
you mean this right?
@Mostlyk you mean this right?
That for example, yea. Maybe you have some other overwrites anywhere as well. Maybe via cloudflare or something else
MostlykOP
ummm could it be that camp.iicpc.com might be affecting that?
it still should show old site?
@Mostlyk ummm could it be that camp.iicpc.com might be affecting that?
why do you think that?
MostlykOP
because that's still has the same domain? and uses the cache?
idk I am not really familiar with how DNS works actually
@Mostlyk it still should show old site?
when you (you as person) refresh the page, do you get anywhere the old version? Than we can take a look at the headers as well
MostlykOP
yes yes camp.iicpc.com should show the old version
@Mostlyk idk I am not really familiar with how DNS works actually
it's not an DNS cache issue. The DNS cache is for everybody the same. So when you get it, I would get it too. But I get the new version. So It's not about the DNS cache
MostlykOP
I think we should buy another domain for old version
@Mostlyk yes yes camp.iicpc.com should show the old version
hmm
camp.iicpc.com
is not reachable for me (DNS_PROBE_POSSIBLE) π€@Mostlyk I think we should buy another domain for old version
you can add unlimited subdomains to your own domain
MostlykOP
oh yes , I did reset DNS today and that is also showing the cached site onli
only*
yup it's unreachable if it's not cached
Great, do this please: https://nextjs-forum.com/post/1324378019627798612#message-1324382718636593232 <---- click
And also share a screenshot of this:
https://nextjs-forum.com/post/1324378019627798612#message-1324383140537696266 <--- click
And also share a screenshot of this:
https://nextjs-forum.com/post/1324378019627798612#message-1324383140537696266 <--- click
@B33fb0n3 Also take a look inside the build log. What's the icon of your page?
MostlykOP
/favicon.ico it's in public folder
@B33fb0n3 Great, do this please: https://discord.com/channels/752553802359505017/1324378019627798612/1324382718636593232 <---- click
And also share a screenshot of this:
https://discord.com/channels/752553802359505017/1324378019627798612/1324383140537696266 <--- click
MostlykOP
yeah i removed the old version from vercel's account
and also removed headers
it's deploying without the headers I added earlier
@Mostlyk /favicon.ico it's in public folder
what's the icon for the
/
route?@B33fb0n3 what's the icon for the / route?
MostlykOP
I have kept
<link rel="icon" href="/favicon.ico" />
on layout
removed headers btw
deployed
MostlykOP
@Mostlyk Click to see attachment
this is from the newest deployment?
@Mostlyk Do you have a person that get the "old version", when he refreshes the page (maybe even yourself)?
MostlykOP
yes I do
I have it in my brave browser
great. Open that page and open the dev tools. Go into your network tab. DONT set the checkmark at "disable cache" (as your customers wouldn't as well).
Now refresh the page. You now see a lot of requests. Open the first one. And send a screenshot of all the response headers
Now refresh the page. You now see a lot of requests. Open the first one. And send a screenshot of all the response headers
no requests :(
wait mb
i am stupid
@Mostlyk no requests :(
remove your filter
MostlykOP
i am searching
π no cache but 302 is wild , i have never dealt with this stuff, as an undergrad it's confusing
@Mostlyk Click to see attachment
can you visit your GSE server and invalidate their cache?
MostlykOP
umm I did go to search.google.com and ask for a recrawl
Are you sure you are on the correct page? As in the request there is a search param but in your url there isn't. The request is 100% managed by the client...
@Mostlyk umm I did go to search.google.com and ask for a recrawl
You mean the search console from google?
so we are using godaddy's domain
@Mostlyk yeah I am refreshing this page
Are you sure? If a search param is inside your request for the inital page it normally is in the url as well π€
@B33fb0n3 Are you sure? If a search param is inside your request for the inital page it normally is in the url as well π€
MostlykOP
yeas , yeah you are absolutely right idk why it's not showing there, other request are the api calls we are making to ibb.com so it's pointless for those
@Mostlyk yeah
yea, then invalidate their cache. Google search Console normally has nothing to do with caching and server. But maybe you hosted your page via google servers before
@Mostlyk It looks like your old version was deployed using the google cloud. Make sure you invalidate the cache there
@B33fb0n3 yea, then invalidate their cache. Google search Console normally has nothing to do with caching and server. But maybe you hosted your page via google servers before
MostlykOP
I am pretty sure we never used google per say, we deployed via vercel on the domain we bought from godaddy
I will still ask the team who worked on the old version tho
Thanks!
@Mostlyk I am pretty sure we never used google per say, we deployed via vercel on the domain we bought from godaddy
GSE = Google Servlet Engine. And when searching for that you can see it's likely used when deploying via google cloud. Make sure the cache there is invalidated and then the new page will also be visible
MostlykOP
yup will see this
@Mostlyk yup will see this
Update this thread when you got a response
@B33fb0n3 Update this thread when you got a response
MostlykOP
yes sure, thanks for the help!
@Mostlyk any update?
@B33fb0n3 <@1114939504999018556> any update?
MostlykOP
Nope , I will update the thread asap if I get it
@B33fb0n3 <@1114939504999018556> any update?
MostlykOP
So no the prev team didn't use GSE..
@Mostlyk So no the prev team didn't use GSE..
how does the "Server: GSE" appears inside your Response Header?
Like the response headers are set by the server that handled the request. And the server said: "I am GSE" (Google Servlet Engine). How does this happen?
Like the response headers are set by the server that handled the request. And the server said: "I am GSE" (Google Servlet Engine). How does this happen?
@Mostlyk ?
@B33fb0n3 <@1114939504999018556> ?
MostlykOP
Hey super sorry about not being responsive for the past couple of days, I had my academics on a roll.
@B33fb0n3 how does the "Server: GSE" appears inside your **Response Header**?
Like the *response headers* are set by the server that handled the request. And the server said: "I am GSE" (Google Servlet Engine). How does this happen?
MostlykOP
So regarding this, I am still finding other people who are seeing the cached website and checkin their headers because could it be that that specific header is from a different cache file in my local computer?
Because we didn't use GSE
Only thing we used was Vercel Analytics which prolly doesn't use GSE
@Mostlyk So regarding this, I am still finding other people who are seeing the cached website and checkin their headers because could it be that that specific header is from a different cache file in my local computer?
even if that would be the case, then you would also see a different website. But you are seeing the correct website and the header is bound to that. So I don't think that's the case
@B33fb0n3 even if that would be the case, then you would also see a different website. But you are seeing the correct website and the header is bound to that. So I don't think that's the case
MostlykOP
yeah, we had a gooogle form script, I am also removing that from google account or lookign ways to do that
@Mostlyk yeah, we had a gooogle form script, I am also removing that from google account or lookign ways to do that
in your case the whole page was served from a google server. And this google server still serves the cached version to your other customers. So when you delete that cache, the new version will be served
@B33fb0n3 in your case the whole page was served from a google server. And this google server still serves the cached version to your other customers. So when you delete that cache, the new version will be served
MostlykOP
hmm, no so good news is I went on the prev code base and found
the script that was loading/ getting requested to has the same url as our google forms script
so I assume deleting/ removing that link would perhaps solve the issue right?
MostlykOP
I deleted the script but the cache is still persistent
@Mostlyk nah, the server that served that page (something from google) most be revalidated. Else it will still serve it
@Mostlyk we didn't use google to serve ever
hmm ok. What's the
Server: GSE
inside the header then?@Mostlyk ?
@B33fb0n3 hmm ok. What's the Server: GSE inside the header then?
MostlykOP
yeah I am not sure either, it's still there even after deleting the script
I guess there must be no way to fix it as it's in the user's computer
Yea, the solution would be to invalidate the cache from the GSE server