I need to improve load times for my site. I have a node backend serving a lot of static pages (html, css and a lot of images) that take a long time to load.
I have offloaded all my images to a bucket on s3 in an effort to make the site faster, but it hasn't had a huge effect.
Is there another way I can improve load times on my site? I would really appreciate all the help I can get. Thanks!
A relatively easy and inexpensive way to speed up the serving of static assets is to use a CDN, like AWS Cloudfront. CloudFront has edge sites around the globe, so the idea is that a user's request is automatically routed to the closest edge, which caches your assets to speed it up and reduce the load and bandwidth on your backend.
Here's what I would do:
If much of the content served by your Node app is static (like assets for a web front-end) you may also consider serving those from S3 as a static site to simplify things and save money on compute.
This is great advice ^^
Just wanted to add that CloudFlare is a fairly simple alternative to AWS CloudFront & might yield the most bang for your time.
Definitely invest in learning the basics of cache-control headers though. That will apply to any solution in this space.
The site isn't entirely static, it has a lot of dynamic aspects as well.. but you have pointed out a lot of things that I will look into now.. Thanks!
For mobile website: https://testmysite.thinkwithgoogle.com/
For desktop/pc version:
https://developers.google.com/speed/pagespeed/insights/?hl=de
(Don't worry,google will auto detect ur browser language & will open it in ur preferred language.)
These links will tell u the faults ur site is having.Basically it is listed under the following heads: 1) reduce server response time. 2) Remove JavaScript and CSS resources that block rendering in content above the fold. 3)optimize images. 4)use browser caching.
Now once u know ur faults,handle them one by one.
If u r using wordpress,there are some awesome plugins to do the trick for u on auto mode.
For any help regarding the optimization & score 100 on page speed, reach out to me on my email : samaddarsubhabrata@gmail.com
Let There Be Light
Subh.
Thank you so much for the response! This really told me where the issue lies and helped me figure out how I could fix it.
S3 without CDN is pretty slow. Anyway, post here the url or try analyzers like tools.pingdom.com, developers.google.com/speed etc.
It is really hard to give an advice without knowing the tech stack but .. I would:
Thank you so much for this great response... I was able to get it to load much quicker once I compressed the images and linked to them on s3. I'll look into CDN's to see how much of a difference it would make!
If the content is just static HTML, my advice is to put it on Firebase, using a subdomain.
Firebase is part of the Google Cloud offering, it's blazing fast, and with a generous free tier.
This is the simplest thing you can do to make the content faster.
I host my Hugo-based blog there, I generate static HTML locally and then I push it to the Firebase servers with a simple
firebase deploycommand.Firebase Hosting is pretty awesome in its simplicity and I don't need to worry about server issues. I wrote a short guide here: https://flaviocopes.com/firebase-hosting/ a few weeks ago.
This is an option, of course there are many other things you can do to speed up a website which involve diving into the technical details, some of which well explained by other replies in this topic.
I was thinking the same until I noticed Firebase Hosting has really high response times (from 10 to almost 60 seconds sometimes) at least in my country (France) for requests that do not hit an edge node. For sure, it does not always happen but if you have an app hosted by Firebase hosting that is bundled with multiple files to leverage HTTP2 (e.g. developed and packaged with Polymer), then it's blazing slow. It kills the user experience and your business!
You may need to hire some one to investigate it.
Here is the main things to look at:
Thank you so much for this detailed response! I'm currently looking into caching and cdn's but all the things you have listed should really help me out in the future as we (hopefully) scale.
Too little context for me to isolate your problem but here are some guesses:
Reach out to me @ mahadevan.k@gmail.com if you need more help.
Adding https://github.com/turbolinks/turbolinks to your site will instantly improve your load time.
check cloudways, they have amazing varnish feature and great optimalization tools
Possible you got unlucky with the specific server you were issued? I had this with an EC2 instance from AWS, don't know why the TTFB was taking 3-5 seconds. Fiddling with all my configs then tried another server (deactivated current EC2, and got another one) and was back in the normal range of a couple hundred milliseconds.
Cloudflare is another CDN to consider.
People have already mentioned the common reasons due to being slow.
I don't know if you're aware, you can check how long things load on your site using Chrome's dev tools. Attached is a screen shot for example.
To really know the speed and order of things loading (use an incognito browser once) so you don't have cached items being used.
Here I load indiehackers in an incognito window
https://i.imgur.com/BGqsdJM.png
Not terrible, but not too bad either (should be at or below 2 seconds, the blue number).
the number appears to change though, tried it again was just over 2 but that could be caching. will confirm in firefox incognito. 3.31 seconds
My speedtestnet result is 56.70Mbps down 75.16Mbps Up on Google Fiber
Another thing to try is the throttling in Chrome dev tools you can simulate slow internet speed and see how your site reacts.
https://www.producthunt.com/posts/smaller
That is a product I use and reccomend!
Can you report the load timing that chrome developer var can give you ? Or, way easier, can you post the link for your website here ?
Try this https://testmysite.thinkwithgoogle.com . You will know whats good and whats bad with your site and also a report on how to fix them.