[Support Guide] Performance troubleshooting your Netlify site

last reviewed by Netlify Support in June 2024

This article will describe our most frequent performance troubleshooting caveats and advice, for speeding up your Netlify site.

Our CDN may behave a bit differently than you or your typical benchmarking tools expect. When you say your site is slow, this is what we check on:

  1. Is DNS configured correctly, to leverage our CDN? Also: are you proxying to us, which adds a hop to any pageload and will thus slow down every pageload?
  2. Are you using any custom caching settings? We review them to ensure you aren’t preventing safe types of caching (essentially: do you change cache-control: max-age=0,public,must-revalidate to something more restrictive?) and we also check how well your site makes use of our caching model by not changing unnecessarily many files with each deploy.
  3. Check your auth. Make sure you’re not using the Basic Auth type of password protection, since HTTP basic auth protected content cannot be cached on our CDN, as authentication is done at the origin, not the edge. Our other types of protection, including Identity service using JWT’s, and all of our other team-wide & site-wide protection do all authenticate with good performance, at the edge.
  4. Consider what content needs to be dynamic. If your page has consistent content between deploys, you should not be using a lambda function - SSR nor ISR to render it! If your lambda output can be cached, prefer ISR to SSR, to allow our CDN to temporarily cache the output to save visitors in the near-term future from having to wait for your lambda to run again. If your images don’t need to be resized dynamically, don’t set up your site to do that. If you have an Edge Function running on every asset load for your site - are you sure it needs to run for all of them? Could you perhaps apply it more selectively?
  5. You’re only as fast as your backend. If you proxy to another service or call functions, keep in mind that we can’t accelerate those things nor control how fast they respond. If your functions are running slowly check out this guide on how to troubleshoot why they are slow
  6. Keep in mind that our CDN caches opportunistically and cache is per-node; busy sites (excluding dynamic/un-cacheable content such as SSR for Next.js or Gatsby sites) are served from cache. Most locations have several nodes, so you may need to reload several times to get your content cached in your nearest location when testing a new page or site.
  7. Our CDN does not effectively cache large files (several megabytes and larger); keep things small.

Finally, please keep in mind that automated performance or load testing is forbidden without specific written permission from our team by our terms of service - and we generally don’t grant that permission below the Enterprise account level, so if you see some sporadically slow behavior, setting up a 10,000 page load test might lead to more consistent results, but it could also lead to us deactivating your account. So, please follow the guidance below for help in diagnosing, instead!

Still have trouble? Please send us a HAR file (preferrered) demonstrating the issue - after scrubbing it of sensitive details using https://har-sanitizer.pages.dev/ (please make sure to only redact the Authorization field, and any other sensitive tokens as well as any cookies excepting ones that start with nf_ which are all safe to share)! Or at a minimum, you can send us the x-nf-request-id for a slow request. Then, we’ll be happy to investigate.

1 Like

Hi @fool , I’ve checked settings and still have trouble, could you help us figure out that?
The x-nf-request-id is 01G0C595SVG5YCD417A2V2VGYJ

Thanks.

Hey there, @awxxxxxx :wave:

Thanks for reaching out, and welcome to the Netlify Forums! Can you describe a bit more what performance issues you are experiencing? We are happy to look at the x-nf-request-id, but a brief description of what you are experiencing as well as what you have already done to troubleshoot would be beneficial to us.

Thanks!

Hi @hillary , thanks for your reply.

As you can see in above picture, file1 ( x-nf-request-id: 01G0MBTXJ2E0E8EEP2HSRNQZWZ) is hosted in netlify which costs 731ms to load, and file2 is hosted in other server which costs 106ms to load. That is huge gap between between two files. So can you help us figure out whether the CDN works normally on our website?

Thanks.

Hi @awxxxxxx,

I checked that file and got the following stats:

Note that, the content download time is not totally in our control. However, TTFB to some extent, is - which seems to be 300ms consistently for that file in my tests. From our point of view, this seems normal, but is this not what you’re seeing?

A post was split to a new topic: Website not working like it does in CodeSandbox