I have developed a rather simple site on nuxt 3 that I have deployed on Netlify, everything works but it happens randomly that the first loading of the site takes a considerable time.
I have tried to manipulate several aspects of the nuxt 3 configuration file and have not been able to find a solution to my problem.
However, the problem only occurs when the site is not visited for a certain period of time (ten/twenty minutes), once the first long load is over, all subsequent loads (within a short period of time will be instantaneous).
I took a closer look at our logs and it seems we’re serving that request within the expected time, by the time it reaches our network so it must be something on DNS resolution.
- try with a different device/network : thats is the same thing, all the friends I have asked to visit the website have this problem and it’s not the first time, i have another site on Netlify with the same issue : https://bellanger.agence-aurion.fr/
Netlify looks very good, but currently in France, it seems that there are latency issues that prevent me from using it seriously.
You still didn’t answer/try the 2 other options. Netlify works perfectly in France. The fact that it’s taking so long in DNS resolution means that the connection is not even hitting Netlify.
We checked and your DNS is not even being managed by Netlify. You should probably contact your DNS host to find out about the latencies in DNS resolution.
I tried with a VPN but the problem is the same, the first load after a while without going to the site can take more than 10s, once loaded if I refresh the page I have no problem.
Anyway the problem can’t be solved by asking users to have a VPN or to change their DNS. As mentioned before the problem occurs with several people, on several types of computers/phones, on several types of networks.
The domain https://www.leaf-band.com/ and https://bellanger.agence-aurion.fr/ are both hosted on ovh.com, we are a web agency and a lot of the sites we have developed are behind domains hosted on ovh.com pointing to dedicated servers and we have no problems. However, as soon as I point one of these domains to a site hosted on netlify, I get huge latencies.
Hi, @Tonyweb. It looks like you are trying to delegate the DNS for a subdomain of agence-aurion.fr to Netlify DNS. I say this based on the following recursive query for the IP address for agence-aurion.fr`:
$ dig +trace bellanger.agence-aurion.fr A
; <<>> DiG 9.10.6 <<>> +trace bellanger.agence-aurion.fr A
;; global options: +cmd
. 48633 IN NS e.root-servers.net.
. 48633 IN NS h.root-servers.net.
. 48633 IN NS l.root-servers.net.
. 48633 IN NS i.root-servers.net.
. 48633 IN NS a.root-servers.net.
. 48633 IN NS d.root-servers.net.
. 48633 IN NS c.root-servers.net.
. 48633 IN NS b.root-servers.net.
. 48633 IN NS j.root-servers.net.
. 48633 IN NS k.root-servers.net.
. 48633 IN NS g.root-servers.net.
. 48633 IN NS m.root-servers.net.
. 48633 IN NS f.root-servers.net.
. 48633 IN RRSIG NS 8 0 518400 20220815170000 20220802160000 20826 . heNj7Re3XSAOExs0gjIUX7r2QlSVLhEb0BL8lHeu50XRFcWN8A1HpXab EHmoH0BpaMmjMMs2AcULkdCq8rFGndxsJ6NIBMppv9P5DtvikOjvG6MJ XiYjl4bdW+UcjEJStrFl2XsHf7gVxVyRug+UyM47ha43kqiDHBf4O+KU 9t1Fcpy6y8qG7HOVFOeSAPdbGSs6R1SjF4HWaP9j+MdCXGPf69yWE7LO q3tphApzpaiDwzGoRH+h2vcJ8WFseNeEPRWf0sssFSwRedC2ri2KVcS4 p3Sy/txy2KNWvHYfuNYYNEe6Ek5X2Yco2vQ5dkWmQXC0O2JSjttsR6Wh 2OOdTg==
;; Received 525 bytes from 8.8.8.8#53(8.8.8.8) in 63 ms
fr. 172800 IN NS e.ext.nic.fr.
fr. 172800 IN NS f.ext.nic.fr.
fr. 172800 IN NS g.ext.nic.fr.
fr. 172800 IN NS d.nic.fr.
fr. 86400 IN DS 51508 13 2 1B3386864D30CCC8F4541B985BF2CA320E4F52C57C53353F6D29C9AD 58A5671F
fr. 86400 IN RRSIG DS 8 1 86400 20220816050000 20220803040000 20826 . J3KBO9g49Afy+4a1EvPMzbdDqGHLYdh8Tw/ERR9eeuXPcHfuMt9vnd87 z9y4QB8TIcGHzcoizNEPuq15HEJcqXpHAkf7BCtr1dgE9k4PKQOtk3HZ HNfa0J2kWkpblwL5GJmLjwv9yhK1r0TnSNiuRueuaVtdnb68Qx24jfoh gBs7S1fxvulkms0bVfZcombShtIu5b6Pll7Wlef++Zqef/i9ZHCPR5b/ LjyTh2YxkeGvs9yDclRZLECvjTsQ7+V8lZQnwnnNp/JPq34DYDjGfoAF lPEg/XLsdYdNSiNa5ckSC2r0PneMpZACCJM8CHMRggFJAdh1fIxYfra0 PxnF3A==
;; Received 648 bytes from 192.33.4.12#53(c.root-servers.net) in 47 ms
agence-aurion.fr. 172800 IN NS dns101.ovh.net.
agence-aurion.fr. 172800 IN NS ns101.ovh.net.
HSE6LVEAKJI7RI5C4E8A03BFG5HA71AO.fr. 5400 IN NSEC3 1 1 1 297E821C HSE6PKPOMG50JK2DK02DRF66LR6OOQFN NS SOA TXT NAPTR RRSIG DNSKEY NSEC3PARAM TYPE65534
HSE6LVEAKJI7RI5C4E8A03BFG5HA71AO.fr. 5400 IN RRSIG NSEC3 13 2 5400 20220927065636 20220729060347 38791 fr. VQetZeSn14w9pjVjBgxIXJSCG25ys2nngRftLzjfsWuuuZdukWRMqfqf 5NT8qdiWrolbHuXHx+nNQo3eseYyvw==
2SQ7K7R361LMH0I70Q8LK8HGE75646N1.fr. 5400 IN NSEC3 1 1 1 297E821C 2SQBPT1TMR5INJJK4HMMLNPEQMVDJUOP NS DS RRSIG
2SQ7K7R361LMH0I70Q8LK8HGE75646N1.fr. 5400 IN RRSIG NSEC3 13 2 5400 20220927105206 20220729100457 38791 fr. vz0M/un8H2eAbt5EAksDvQmCs/tCh0wLI9yzuExgTKgtJIa21oqgnoCz TjPjtrejrajWlVV/5rX46HK8eOmKQw==
;; Received 502 bytes from 194.146.106.46#53(f.ext.nic.fr) in 37 ms
bellanger.agence-aurion.fr. 60 IN NS dns3.p03.nsone.net.
bellanger.agence-aurion.fr. 60 IN NS dns4.p03.nsone.net.
bellanger.agence-aurion.fr. 60 IN NS dns2.p03.nsone.net.
bellanger.agence-aurion.fr. 60 IN NS dns1.p03.nsone.net.
;; Received 144 bytes from 213.251.188.145#53(dns101.ovh.net) in 157 ms
bellanger.agence-aurion.fr. 20 IN A 35.247.66.204
bellanger.agence-aurion.fr. 20 IN A 34.83.23.240
;; Received 87 bytes from 198.51.44.67#53(dns3.p03.nsone.net) in 17 ms
I’m going to repost the section above that shows the subdomain DNS delegation:
bellanger.agence-aurion.fr. 60 IN NS dns3.p03.nsone.net.
bellanger.agence-aurion.fr. 60 IN NS dns4.p03.nsone.net.
bellanger.agence-aurion.fr. 60 IN NS dns2.p03.nsone.net.
bellanger.agence-aurion.fr. 60 IN NS dns1.p03.nsone.net.
;; Received 144 bytes from 213.251.188.145#53(dns101.ovh.net) in 157 ms
That shows the ovh.net name server saying that the name servers (NS type records) for the subdomain are the NS1 name servers (which Netlify DNS is using for DNS infrastructure).
Netlify DNS does not support subdomain delegation. The solution for this will be to delete the DNS zone here:
and to use the external DNS instructions below instead:
Alternatively, you can move the DNS service for the domain to Netlify but that is optional and not a requirement in any way. If you want to use Netlify DNS, please be sure you have copied all existing and required DNS records to Netlify before changing the name severs for the domain at the registrar.
If there are other questions about this or if either solution above does not work, please let us know.
Because I always have this problem of cold start when I go on https://bellanger.agence-aurion.fr/ after a certain time the site takes several seconds to be displayed, then once displayed all the following refreshments (f5) will be instantaneous.
You need to go here: Netlify App, scroll to the end and click on “Delete DNS Zone” to get rid of that. That’s not causing trouble with this problem anymore, but it’s worth removing it anyways.
To solve the actual issue, would you mind sharing the HAR file that shows a slow load? That would help us make sure we’re all looking at the same issue.
Additionally, I can see that you’re using Nuxt 3 with Netlify Functions preset (default), and that’s probably going to be slower than the alternative Netlify Edge Functions preset. You can configure this preset by using:
nitro: {
preset: 'netlify-edge'
}
(if I recall correctly)
That’s expected to be faster than Netlify Functions. However, last time I had used it, Nuxt.js did not work and gave me the error mentioned here:
Since the issue is still open, I am assuming it has not been fixed, but you’re free to try.
I tried the Netlify Edge Functions preset but i got and error when building on Netlify :
12:19:43 PM: ────────────────────────────────────────────────────────────────
12:19:43 PM: Bundling of edge function failed
12:19:43 PM: ────────────────────────────────────────────────────────────────
12:19:43 PM:
12:19:43 PM: Error message
12:19:43 PM: There was a problem setting up the Edge Functions environment. To try a manual installation, visit https://ntl.fyi/install-deno.
12:19:43 PM:
12:19:43 PM: Error location
12:19:43 PM: While bundling edge function
My nuxtconfig :
nitro: {
preset: "netlify-edge",
},
I will concentrate my tests about DNS on https://www.leaf-band.com/ wich is also on netlify. I will try to get you a HAR file from it too.
Thanks for your patience. We have opened an issue with one of our teams to investigate this further. In the interim, I believe the best path forward is to keep the app loading slowly with your original approach, versus keeping the functions error while bundling.
When we have more information a member of the team will follow up here. Do not hesitate to reach out in the interim if anything changes!
Using the preset “netlify-edge” for the nitro engine should probably resolve the issue (not tested yet because one of my dependencies is using axios and thats not supported within DENO V8).
What I came up with was to request a region change to eu-central-1 or near your region: Changing deployment region?
Afterwards the cold start was drastically reduced, not perfect but reduced.
Hey folks! Happy to update the functions region for you (but that will only affect lambda functions, not edge functions, just as an FYI - and we’ll only be able to do it for customers with a Pro or higher team, just to set expectations).
This post describes what a teammate mentioned when we raised this issue:
this is just a workaround, but may help you get things working at least!
Hey, i tried with preset “netlify-edge” but i had somes 404 issues with js and css bundles. So I went back for the moment. Cold start still here. Im using the latest version of nuxt 3 (rc11)
Hi @fool, im not using pro account, i can’t update the functions region i guess. There is more a technical issue here, something from netlify with Nuxt. Netlify technical teams should investing on that.
I know you mentioned that the preset netlify-edge didn’t work, but if you can let us know if that workaround made a difference, that would help us troubleshoot further.
Someone at Netlify should really investigate this, I have randomly extremely long load times for no logical reason.
In the example below you can see two loads of the same page, the first one was done on Wed, 19 October 2022 16:44:10 and the second on Wed, 19 October 2022 16:45:31, 1min20 apart!