Community

Slow speed index for my ReactJS website

OA
Osama Alsamai #1

What does the website slow
The SLL from cyperpanel

jo
josephgodwinke #2

Welcome @Eng.Osama Happy you are here

This is vague. What is slow? the database queries, http requests, loading of images and videos ?

OA
Osama Alsamai #3

When i test the speed website i find the speed index is slow
Also get photos and information from database is slow

jo
josephgodwinke #4

This has so little to do with cyberpanel as most of the time the index for js based websites is handicapped by JS execution time. Therefore this is dependent on how code is written, built or compiled. This entirely based on code and nothing else. Employ code splitting and other best practices to your code

jo
josephgodwinke #5

Improve mariadb performance by creating or editing nano /home/cyberpanel/.my.cnf e.g. reduce no of maximum connections etc. I advice you check mariadb documentation about this.

then restar mysql service

sudo /etc/init.d/mysql restart
OA
Osama Alsamai #6

the database queries and loading the photos and videos
Are slow

jo
josephgodwinke #7

Avoid spaghetti code and use proper react libraries for data fetching and lazy loading images. Examples would be prisma react components, tanstack query aka react query v4, react image lazy load component etc a quick search engine lookup will point you in the right direction

Sign in to reply