I have a landing webpage in which images are loaded from the database.It is not user-interactive. It is mainly used for SEO purpose.
Currently it’s taking around 5s to load the page. This page is currently created in ERB template for ruby and is working on rails.
We want to increase it’s loading speed.
Will using React JS as front end reduce the loading time of the page? If not, what is the other alternative?
3
Answers
If You need to use the fastest JS Framework, try Vanilla JS. Its definetely faster than both React and Angular
Most likely you do not need react.
Probably the reason for the slowness is the image sizes. You can either try to optimize the images for web (ex. using WebP: https://developers.google.com/speed/webp/ and https://css-tricks.com/using-webp-images/) or use lazy loading, for example: https://github.com/verlok/lazyload .
To find out why the page is slow, you can use Chrome or Firefox devtools waterfall or for more indepth, Google Chrome has ‘Audits’ under devtools.
I’d start out with the devtools waterfall under Network tab.
I would suggest using an Amazon S3 bucket to store your images and implement AWS’s CDN Cloudfront to cache your content closer to users.
I would also add that a 5s load time is almost certainly not being caused by your framework and is more likely hardware related.
You may also want to consider preloading your images.