Jump to content

Pagespeed, First Visit Slow Second Ok


Recommended Posts

Hi,

 

I have been trying to tweak my site to become a little bit faster. First visit is pretty slow but if I visit the same page again right after then its fast. When waiting for about 10 minutes again the page loads slow again. 

 

Im using Prestashop 1.6.1.4, MariaDB 10.1, OPCache 7.04 and have Smarty Cache and CCC turned on. Mysqlquerysize is 128MB, PHP memory limit is 256MB.

 

The querying time is fast, but it seems like its the wait time that is slow when I check with Pingdom.

 

Does anyone have a solution for this or can give me a hint of something I can try to tweak to get this to work faster? Does it have something to do with cache? .htaccess? 

 

Thanks in advance

 

 

post-341539-0-34143200-1455616294_thumb.jpg

post-341539-0-70457800-1455616302_thumb.jpg

Link to comment
Share on other sites

Hi,

 

I have been trying to tweak my site to become a little bit faster. First visit is pretty slow but if I visit the same page again right after then its fast. When waiting for about 10 minutes again the page loads slow again. 

 

Im using Prestashop 1.6.1.4, MariaDB 10.1, OPCache 7.04 and have Smarty Cache and CCC turned on. Mysqlquerysize is 128MB, PHP memory limit is 256MB.

 

The querying time is fast, but it seems like its the wait time that is slow when I check with Pingdom.

 

Does anyone have a solution for this or can give me a hint of something I can try to tweak to get this to work faster? Does it have something to do with cache? .htaccess? 

 

Thanks in advance

The WAIT is the time Prestashop is generating the page. To analyse where the time is being spent you can enable PROFILING.

Link to comment
Share on other sites

Thank you for your answer.

 

I have attached two screenshots in my first post with first visit and second visit from profiling. They are pretty hard to see but just click below "Attached Thumbnails"

 

I have tried to analyse it but really dont know how to continue. The things that take the most time is_construct and initcontent.

 

The page is loading fine the second time so it got to have something to do with the cache that works for the second time. But I really dont know how I can extend this time. The OPCache seems fine, 57% full memory. The querying time is low - only around 100ms. The site is not public so Im the only one visiting right now.

Link to comment
Share on other sites

But I think there will be a couple of times where I dont have visitors for 5-10 minutes and then it will be slow again. 

 

I have tried to turn everything off, except OPCache, and restarted Apache. I can still get a descent speed with a loading time of 571ms for the second visit.

So there must be something else that is helping the me out with caching. But I dont know what!

 

 

 

 SMARTY
Never recompile
 
Cache
No
 

 

CCC

Smart Cache för CSS
No
Smart Cache för JavaScript
No
Minimera HTML
No
Komprimera infogade JavaScript i HTML
No
Flytta JavaScript till slutet
No

Apache-optimering

No

 
CACHNING
 
Use cache
No
Edited by Briljander (see edit history)
Link to comment
Share on other sites

 

But I think there will be a couple of times where I dont have visitors for 5-10 minutes and then it will be slow again. 

 

I have tried to turn everything off, except OPCache, and restarted Apache. I can still get a descent speed with a loading time of 571ms for the second visit.

So there must be something else that is helping the me out with caching. But I dont know what!

 

 

 

 SMARTY
Never recompile
 
Cache
No
 

 

CCC

Smart Cache för CSS
No
Smart Cache för JavaScript
No
Minimera HTML
No
Komprimera infogade JavaScript i HTML
No
Flytta JavaScript till slutet
No

Apache-optimering

No

 
CACHNING
 
Use cache
No

 

 

all of the above should be set to 'yes/enabled', you can leave CAHNNING Use Cache = No for now

Link to comment
Share on other sites

Hi El Patron,

 

Thanks for your answer.

 

I know. Just wanted to show that i can get decent page loading with these turned off.

 

Thats why Im wondering what it is that is helping my site to load fast the second visit. All these tweaks are off so it must be something else and i would like to know what it is so maybe i can make it last longer.

Link to comment
Share on other sites

first page load requires load of CCC  of .js and .css files, the large files, among others.  (.js files should be loaded bottom)

 

re-visit of the same page will be significantly faster (assuming mod_expires for CCC  of .js/.css)

 

this is nature of previous PrestaShop versions which is still better than most...but...read on

 

in 1.7, we will have one CCC .js/.css file, across multiple pages, this is going to be a 'significant' performance improvement.  Above the fold across multiple pages will be super fast.

Link to comment
Share on other sites

first page load requires load of CCC  of .js and .css files, the large files, among others.  (.js files should be loaded bottom)

 

re-visit of the same page will be significantly faster (assuming mod_expires for CCC  of .js/.css)

 

this is nature of previous PrestaShop versions which is still better than most...but...read on

 

in 1.7, we will have one CCC .js/.css file, across multiple pages, this is going to be a 'significant' performance improvement.  Above the fold across multiple pages will be super fast.

 

Oki, good to know how it works. I been searching all over the Internet to find a solution.

 

But does the .js and .css reload every 3-5 minutes for the next visit? I am using mod_expires and its set to 1 Week or more. 

 

I have found some discussions talking about Apache having long TTFB at first visit and then second visit seems to be quick: But I cant seem to find any solution for this.

 

Sounds great with that improvement in 1.7!

Link to comment
Share on other sites

Its using a some swap:

 

Current Memory Usage total used free shared buffers cached
Mem: 1016068 1005704 10364 59012 2852 106804
-/+ buffers/cache: 896048 120020
Swap: 2097148 290648 1806500
Total: 3113216 1296352 1816864

 

Anyone think my issue will be better if I upgrade my VPS from 1GB, 2 Cores Intel® Xeon® CPU E5-2620 v2 @ 2.10GHz to a VPS with 2GB RAM and 3 Cores or is this just a Prestashop problem?

 

That the TTFB will be reduced at first visit?

Must clarify that the site isnt public so there is no load at all right now.

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...