Jump to content

Optimize initial server response time - Make your site faster


Henrik41

Recommended Posts

Let's share ideas on lowering the TTBF (Time for first byte):

 

   1. Infrastructure:

       a) I use VPS and never use shared hosting.

       b) Server has to have > 1 CPU to increase speed and at least 2048 MB of RAM.

       c) I use Nginx as a server and fast-cgi with PHP 7.3 (+ libraries) for the new version of Prestashop.

       d) I optimize the Nginx config including adding http2 and connecting to a socket for my php-fpm process.

       e) Gzip!!! use Nginx config to set it up.

       f) Always use Nginx cache system.

       g) I always test the server infrastructure BEFORE installing Prestashop.

   2. Template:

       1. Always test your template with GTmetrix before buying it.

       2. Limit the number of item showing in the front page.

       3. Always use the 3 C (Compress, Combine and Cache).

   3. Limit the number of modules/plugins etc.

   4. Use a CDN. I repeat use a CDN!

 

Any other suggestions?

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

We will reply how our professional see your information.

Power (Server, Infrastructure, Initial Loading Time):

a) I use VPS and never use shared hosting.
We always test this point "I use VPS and never use shared hosting." <- VPS is sharing hosting just sometimes you don't realize how much. Just many times smaller and not always true and dedicated.

We have dedicated hosting provider that don't show up error : Initial Response Time.

ALWAYS CHECK WHAT YOU GET - Real power, real RAM and real SSD. Prestashop require good amount of power. Cheap hosting will showcase problem in future.

b) Server has to have > 1 CPU to increase speed and at least 2048 MB of RAM.

Yep, that's required. We will rewrite Polish documentation to showcase this more that's what recommended

c) I use Nginx as a server and fast-cgi with PHP 7.3 (+ libraries) for the new version of Prestashop.

We use Apache or LightSpeed and is better suite for built in optimization in this framework. 

d) I optimize the Nginx config including adding http2 and connecting to a socket for my php-fpm process.

Yep, that's good approach. We recommend using good settings. 

e) Gzip!!! use Nginx config to set it up.

It isn't as big deal but yeah - it is on our list from audit in context of speed.

f) Always use Nginx cache system.

Yes. But Prestashop pages are static. You can really help by sharing configuration.

g) I always test the server infrastructure BEFORE installing Prestashop.

Yeah. We use on first run by simply installing demo and try some benchmark. In many times just opening first page of demo app showcase problems (if there is problem on demo one then yes - it going to be nightmare in future)

Conclusion: Find dedicated server or at least required power. Run one simple demo before anything. Initial response time must be on first go as low as it could be. Fix anything between demo and user Serwer, PHP, MySQL, connection, security, default header etc). There is some level of configuration details that nobody will share and this is somehow sad ;/ Even official GitHub don't have good example of Docker Image. Pleas, if you like to cooperate then contact us - we like to have some good Docker Stack that is production ready. Will benefit all of us.  

Extensions (Module, Theme from Prestashop Panel):

We found poor code in many extension. Theme is many times slow, there is bad code smell and just sad for what we pay for. That need Open Source Alternatives more than payed one. We like to introduce some sort of Open Source modules that anybody can use and install. Right now we don't know how we can code for updating it from GitHub Releases automation like from Prestashop Marketplace is now done. 

Custom / other optimisation:

We don't provide details but pleas, I beg you - override properly !!! Don't mess with core! Use "override" folder if you must.
Try to fix all error that you found and be sure to use profiler. 

Contact Us for details or cooperation :) [email protected]
 

Link to comment
Share on other sites

  • 3 months later...
On 10/21/2022 at 10:00 PM, Webo.Agency said:

c) I use Nginx as a server and fast-cgi with PHP 7.3 (+ libraries) for the new version of Prestashop.

After a long use of Nginx, are you satisfied with the difference between apache?
I was reading about it and they say Nginx is good for more static websites. Like when you have a e-commerce website with a lot of traffic, it is not a good choice.

Link to comment
Share on other sites

I actually have some websites running Nginx and some running apache both having a lot of traffic. Both performing very well. I don't think it makes a huge difference. What makes a difference for me is using Varnish as a cache system. The other thing that makes a difference is having your own dedicated server and more memory.

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...