Jump to content
sfweb

Cache problem with leotheme theme

Recommended Posts

Hi,

we used leo_xalem theme for our ecommerce, but we have a problem.
 

When the prestashop cache is enabled we noticed that every 60 seconds the cached files are created again (in the path /cache/smarty/).
The same does not happen with the default prestashop template.

For instance: the file in the path

/cache/smarty/cache/socialsharing/1488/1/3/3/10/86/fb/3a/86fb3aaf697b1d3a8c25d8285b85f4b22972068b.socialsharing.tpl.php

With leo_xalem the file is recreated every 60 seconds, with default prestashop theme does not happen.

To say this we see the "last modification time" of the file.

The same happens for the other modules and files in the cache directory (/cache/smarty/).

Where is the problem? It seems that the cache time in only 60 seconds when a leotheme is used.

Share this post


Link to post
Share on other sites

You should contact Leo Themes as you have right for support for paid theme.

Share this post


Link to post
Share on other sites

We did that, but at the same time we ask for other help!  ;)

  • Like 1

Share this post


Link to post
Share on other sites

Unfortunately they don't care much about performance....big problem and a real pity because their themes look great.

Share this post


Link to post
Share on other sites

I have doubts the cache expiration is caused by a specific theme. Why ? A theme only calls predefined methods and functions from controllers or modules. And it's up to the controllers and modules how they handle cache expiration.

 

As a cross check - did you try to install default-bootstrap theme and see if your cache expiration still goes on? If yes, the cause is outside of your theme.

Share this post


Link to post
Share on other sites

The double check is the theme (not default) previously installed made my shop load in less than 7sec, now we're at 21 on first loading and 11 on repeated loading. I also checked through various toos and the culprit seems to be a .js and css files inside theme's cache folder.

Same server, same conditions, only theme changed.

Thanks for your opinions though! :)

Share this post


Link to post
Share on other sites

the problem is located in the apppagebuilder.php of module

in this file is present the override of function isCached of class module.

This override cause the problem.

Share this post


Link to post
Share on other sites

Unfortunately a common problem. The deeper and override hooks into the system the more likely it is, it causes unwanted side effects.

Since we don't know what apppagebuilder.php does, it's difficult to guide you.

Maybe have a look at this source code or post it here if it's not huge in size.

Share this post


Link to post
Share on other sites

Thank you @skully! Actually I was hoping @sfweb knew the solution since he started the thread and knows the culprit :)

  • Like 1

Share this post


Link to post
Share on other sites

simply .... remove override function 'isCached' from apppagebuilder.php ;)

 

 

Share this post


Link to post
Share on other sites

Thank you @sfweb! 

Unfortunately I don't see such file neither in theme's folder or override folder...must be a different issue then :S

 

Share this post


Link to post
Share on other sites

Sure.

I tested this page for example: https://shop.socialbusinessworld.org/it/1229-il-mio-frutteto-biologico-edizioni-terra-nuova.html

Webpagetest.org's waterfall shows /themes/leo_tea/cache/v_317_ffe54e684ad6de6cc60b022af43bdd69.js and /themes/leo_tea/fonts/ as very slow. There are other thing but even if I disable those other plugins (ie. livechat pro and cookie law), what makes the page slow for users seem to be the theme.

 

Also Google's pagespeed Insights sees /themes/leo_tea/cache/v_748_39bfbdf9917de176816527ce6178e116_all.css as blocking rendering content above the fold fastly.

What do you think?

 

To add useful info, my server is very powerful, dedicated, 256MB RAM dedicated to the shop now, quad core 4GHz, SSD.

Cheers

 

PS to leotheme team if reading: I really love the look of your themes, this is not a complaint as already told you directly but IMHO the issue needs to be investigated and possibly solved.

Share this post


Link to post
Share on other sites

Is the tested and above linked example YOUR page? If not: it wouln't help to since server settings and server performance is different from machine to machine. And: 256 MB of RAM isn't that much. We usually assign appx. 200 MB only for PHP. Basic requirements for operating system, MySQL database and buffer pools not included.

Edited by Scully (see edit history)

Share this post


Link to post
Share on other sites

I need 9 seconds to load all page content. Off this 9 seconds, the html only part needs 1 seconds (1000 ms). This is not superfast but still acceptable. What I also see: a module maybe called livechat pro is sending requests over an over in an endless loop.It's certainly slowing down your site.

 

And I see javascript in total of appx. 1.6 MB. This looks like a really extreme value to me. Usually or sites load between 200 and 300 kb of javascript. Javascript is known as a speed braker, like CSS also.

 

Finally this request is logged 2 times on my browser - I don't know why but it also dosen't make things faster:

https://js.stripe.com/v2/

Share this post


Link to post
Share on other sites

Well, our tests are not so objective, we should always use external, throttable, services to see how our sites work.

I'm sure you're in Europe, very fast connection and maybe already have cached something after first visit because on 1st load I have an average of 17secs from Europe (server also in Europe) and 9 secs on repeated view (probably the one you're experiencing).

I agree on the js note, it's what I highlighted above /themes/leo_tea/cache/v_317_ffe54e684ad6de6cc60b022af43bdd69.js

 

As for livechat pro, as I said, even if it is disabled, the results are the same (few ms less). It's a chat addon sending requests regularly.

As for Stripe, it's the official addon on PS marketplace.

So, I'm really convinced that the .js and .css in theme's cache are the ones slowing down the site.

 

Cheers and big thanks for trying to help!

 

Share this post


Link to post
Share on other sites

Yes, I am sitting in Europe. My connecton speed is average. And i tested without complete empty cache - always! What the number and size of javascript concerns: disabling might not help. I think you would rather uninstall modules you don't need urgently.
 
And as one more example - this file adds 500 kb for javascript only. This is huge!

https://shop.socialbusinessworld.org/modules/livechatpro/views/js/lcp.js

In my conclusion, some of the heavier effects are not related to the theme.

Edited by Scully (see edit history)

Share this post


Link to post
Share on other sites

I wonder what "average" connection means to you :).

As for js...I still think the following file does not help at all (regarding speed of course :)), it's bigger than the one you mention (not compressed, like the one you pointed out)...and theme's:

URL:/themes/leo_tea/cache/v_323_ffe54e684ad6de6cc60b022af43bdd69.js
Loaded By: /it/1229-il-mio-frutteto-biologico-edizioni-terra-nuova.html:13
Error/Status Code: 200
Priority: Medium
Time to First Byte: 103 ms
Content Download: 5727 ms
Bytes In (downloaded): 196.7 KB
Uncompressed Size: 711.6 KB
Bytes Out (uploaded): 0.4 KB

Share this post


Link to post
Share on other sites

Average means 20 MBit. And in terms of performance it's usually not the clients bandwidth which is the limit. It's the server!

 

I don't know what this js does or why it is this large. It would be a huge effort to figure all this out.

Share this post


Link to post
Share on other sites

For future reference: I have done many tests and disabled all other plugins which could cause the issue (including live chat pro) but the problem is definitely the theme with the following file as per above comments and details. Unfortunately theme devs do not want to take into consideration the issue...and are starting to be rude which I really feel sad about because I am and always will be a kind person respecting others, especially others' work.

 

URL: MYSITE/themes/leo_tea/cache/v_326_ff9a75a59da264a762e1a7972ac33a8f.js
Loaded By: (PRODUCT PAGE)
Error/Status Code: 200
Priority: Medium
Time to First Byte: 118 ms
Content Download: 5203 ms  <<<--------- Note
Bytes In (downloaded): 199.7 KB
Uncompressed Size: 721.0 KB <<<--------- Note
Bytes Out (uploaded): 0.5 KB

Share this post


Link to post
Share on other sites

Your XXL - javascript file is only one problem. However I note around 100 to 200 ms to download this exact file.

The first problem is the size of the file in terms of large code which is executed on the clients browser. Usually larger code does not perform quicker. It is parsed by thw browse and the larger it is, the more parsing must be performed.

 

What we don't know at all at this time. Does this XXL - javascript only come from the theme or a lot of added modules? I assue both is the case. We could see more if you would disalbe CC cache for both: javascript and CSS files.

 

The second problem I assume is the number of modules, external ressources and images you are using. I see popups, sliders, tracking services, facebook tracking, special fonts. All this adds to processing time and needs external resources. Only looking at your main menu - you have douzends of icons there. When I open any submenu my eyes get confused.

 

And last but not least: You have an overall size of the start page of 3.5 mb. At the end I noticed total load time of between 20 and 45 seconds. We have typically only 1 mb for the start pages and they are fully loaded in typically 0.5 to 1 second.

 

My conclusion

Most likely it's partially a problem of the theme. And the other part of the problem is the setup you have choosen maybe also no a not very performing server.

Edited by Scully (see edit history)

Share this post


Link to post
Share on other sites

Thanks again for your time @skully!

I understand all points but please be sure we're on a very powerful dedicated server as mentioned before.

However, Content Download: 5203 ms  <<<--------- Note refers only to that js file, how comes you only see 100/200ms? Maybe here we have some different reading of the problem (webpagetest.org).

 

Thanks again!

Share this post


Link to post
Share on other sites

thanks @mehere i kind of solved .. 

i create my own cache system in php to cache the displayHome, menus, etc.. (my logic is first person visiting the shop every day rebuilds my cache).

from more than 15 seconds (on server loading)  ->  to 1.1 seconds.

from more than 5000 queries -> to 200 queries.

life is beatifull now :) .

Thank you all to pointing me to the cause of the problem.

Edited by ricardo21ferreira (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites
On 1/26/2018 at 7:31 PM, ricardo21ferreira said:

thanks @mehere i kind of solved .. 

i create my own cache system in php to cache the displayHome, menus, etc.. (my logic is first person visiting the shop every day rebuilds my cache).

from more than 15 seconds (on server loading)  ->  to 1.1 seconds.

from more than 5000 queries -> to 200 queries.

life is beatifull now :) .

Thank you all to pointing me to the cause of the problem.

can you share your solution?

Share this post


Link to post
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

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More