Site loading really slow

Hi All,

I tried to deploy our project on Netlify. It’s built correctly and I can see the URL working fine.

But as compared to my self-hosted server Netlify really loads very slow.

https://hsdev.netlify.app/

Please! check this URL

Thank You!

You’re trying to use a JavaScript only website. The JavaScript is 16 MB in size (3.5 MB when served with Brotli) and it’s not even minified.

Netlify is meant to serve small, static assets, and anything over 1 MB to 3 MB in size is not cached in the CDN. So, anything above that size is served from its origin server (in United States, I suppose). The further you’re from the servers, the slower the transfer will be.

So I’d say, what you’re seeing is expected behaviour.

1 Like

So perhaps implementing a minifier inn the production build might help if it is able to reduce size lower than 3MB I am guessing ?

I don’t think you can possibly get a 16 MB file down to less than 3 MB, because if you could, you’d probably not be having a 16 MB file in the first place. Even then, I tried minifying your file and could not get it lower than 15.5 MB.

Note that, when I said about file size limits on caching, I meant the uncompressed version (16 MB in your case) and not the one served with Brotli compression. Netlify applies Brotli while serving those, but for a file to be cached in CDN, the file should be below the mentioned limit before Netlify uses Brotli.

From what I checked in your JavaScript, it looks like you’re also having source maps in the file itself. Removing them might help. Depending on how many source maps you actually have and how big they are, maybe you can get below the mentioned size, because honestly, it’s not a good idea to be serving so much content over JavaScript only. People with slower connections won’t see anything till the file loads and the wait time might go in minutes. You should really consider switching to classic HTML as a fallback and use JavaScript to just enhance it.

1 Like