Jump to content
JPresta.com

[Module] Page Cache - speed up your shop

Recommended Posts

1 hour ago, porrasus1 said:

I cannot be happier with this module, my test site flyes now, pls check it out ...... https://www.njoytrends.com/

But besides module being a must , to more surprising to me was the excellent support and implication with custom integration i needed form developer, i have no words to acknowledge this guy, who is gonna makes me rich :-)

My experience with other module developers support in prestashop addons is not any good, so take care mr speedy and keep developing other modules.

 

 

You might want to check your htaccess file as your site is not resolving to njoytrends.com or http://njoytrends.comhttps://njoytrends.com,

If you wish to speed up your loading times further you might want to set your SSL Domain and Shop Domain without the www. before of your hostname,

https://www.hostinger.com/tutorials/wp-content/uploads/sites/2/2017/03/prestashop3.png

Edited by nicoX

Share this post


Link to post
Share on other sites
5 hours ago, nicoX said:

 

You might want to check your htaccess file as your site is not resolving to njoytrends.com or http://njoytrends.comhttps://njoytrends.com,

If you wish to speed up your loading times further you might want to set your SSL Domain and Shop Domain without the www. before of your hostname,

https://www.hostinger.com/tutorials/wp-content/uploads/sites/2/2017/03/prestashop3.png

Thanks nicox i did but dont really understand why i shoould speed up things this way.

Share this post


Link to post
Share on other sites

I just upgraded the module to the new version 4.28 and now i have the problem that it mixes up cache from the normal site and the mobile site.

I am using prestashop 1.6.1.17 with default theme.

If have disabled many modules on the mobile site, dias, background changer and text boxes e.t.c but now the mobile index page shows these modules even if they are disabled for mobile. Also on the normal site text boxes from the mobile site is displayed on some of the pages.

So it does not seem to be a good idea to use the same cache for normal and mobile site as in this new version ?

What can i do to make my site look normal again ?

 

Best Regards  John

Share this post


Link to post
Share on other sites

Hi Bonjovi67 !

 

If you go to the bottom left of the version number 4.28 inside you're module, you'll find Advanced Mode. Click here and go to the Options tab. Here you will find, Create separate desktop and mobile device cache, check if enabled or not.

 

Best regards

MacRoy

Share this post


Link to post
Share on other sites
1 hour ago, MacRoy said:

Hi Bonjovi67 !

 

If you go to the bottom left of the version number 4.28 inside you're module, you'll find Advanced Mode. Click here and go to the Options tab. Here you will find, Create separate desktop and mobile device cache, check if enabled or not.

 

Best regards

MacRoy

That is great, thank you for the answer.

 

Best regards

John

Share this post


Link to post
Share on other sites

Hi Bonjovi67 !

 

I'm glad I could help you! You are welcome.

 

Best regards

MacRoy

Edited by MacRoy

Share this post


Link to post
Share on other sites

Hello,

I have a problem with pagecache, when the module is enabled my header is deformed (see images below).

Any idea to fix it ? I use pagecache v3.17 and presta v1.6.13

 

Thanks

without pagecache.png

with pagecache.png

Share this post


Link to post
Share on other sites

J'ai installer prestashop 1.7.4 pour test et il y'a une alerte avec le module page cache 4.30 quand je lance l'analyse : Une erreur s'est produite: 

Si HTTPS est configuré pour votre boutique merci de naviguer dans l'administration en utilisant HTTPS.

Pas d'inquiétude, cela n'impacte en rien la mise en cache des pages.

Le https fonctionne bien dans le back office, mais il y'a des pages blanche dans le frontoffice

J'ai installer avec prestashop 1.7.3 et j'ai pas d'erreur https et les pages web fonctionne bien avec page cache.

Edited by ritopina

Share this post


Link to post
Share on other sites
On 05/07/2018 at 10:15 AM, ritopina said:

J'ai installer prestashop 1.7.4 pour test et il y'a une alerte avec le module page cache 4.30 quand je lance l'analyse : Une erreur s'est produite: 

Si HTTPS est configuré pour votre boutique merci de naviguer dans l'administration en utilisant HTTPS.

Pas d'inquiétude, cela n'impacte en rien la mise en cache des pages.

Le https fonctionne bien dans le back office, mais il y'a des pages blanche dans le frontoffice

J'ai installer avec prestashop 1.7.3 et j'ai pas d'erreur https et les pages web fonctionne bien avec page cache.

Si les erreurs persistent je vous invite à me contacter via le support. Merci.

Share this post


Link to post
Share on other sites

Great module, thank you.

I am having an issue with deleting products though. The MySQL queries are taking a very long time, with the same query from PageCacheDAO.php executing 5 times, at 100+ seconds per execution. Logging the MySQL slow queries shows that one product deletion creates ~3MB in the log file.

Here is the query at question. The $url_query string ends up over 600,000 characters, which executed not once, but 5 times, takes a long time, as you can imagine. My shop has ~17k products at the moment, just to give a little context.

$query = 'SELECT DISTINCT pc.id, pc.file FROM `'._DB_PREFIX_.self::TABLE.'` AS pc
  LEFT JOIN `'._DB_PREFIX_.self::TABLE_BACKLINK.'` AS bl ON (bl.id = pc.id)
  WHERE `backlink_crc32` IN ' . $url_query . ')';

My TABLE_BACKLINK is quite large too, currently at +14M lines. The TABLE table is 74k lines.

 

PS 1.6.1.17

 

Can you help?

 

Some info from the slow_query_log_file covering one product deletion:

# Query_time: 91.175904  Lock_time: 0.045711 Rows_sent: 1  Rows_examined: 14305383

# Query_time: 100.045969  Lock_time: 0.043841 Rows_sent: 1  Rows_examined: 14305383

# Query_time: 110.333737  Lock_time: 0.044119 Rows_sent: 1  Rows_examined: 14305383

# Query_time: 109.052453  Lock_time: 0.157412 Rows_sent: 1  Rows_examined: 14305383

# Query_time: 109.088081  Lock_time: 0.095610 Rows_sent: 1  Rows_examined: 14305383

 

Edited by asapho
give a little more detail

Share this post


Link to post
Share on other sites
2 hours ago, asapho said:

The $url_query string ends up over 600,000 characters, which executed not once, but 5 times, takes a long time, as you can imagine.

Thank you for this analysis! Which version of PageCache do you have?

Do you know if it is exactly the same request that is executed 5 times? What change do you do to trigger this reffreshment (price change, photo, description, etc.)?

I guess your shop has a lot of links usually due to a lot of categories in a big menu, doesn't it? If so there is an advanced configuration we can setup for this kind of case.

Share this post


Link to post
Share on other sites

 

9 hours ago, JPresta.com said:

Thank you for this analysis! Which version of PageCache do you have?

Do you know if it is exactly the same request that is executed 5 times? What change do you do to trigger this reffreshment (price change, photo, description, etc.)?

I guess your shop has a lot of links usually due to a lot of categories in a big menu, doesn't it? If so there is an advanced configuration we can setup for this kind of case.

 

I currently have PageCache version v4.22.

The same exact request is firing 5 times; I compared the query strings in NetBeans and they're exactly the same.

There's only one event that I commonly do that takes an exceedingly long time, and that's deleting products; either one at a time or bulk. I.e. PS backoffice/catalog/products/select a product and delete.

My shop's essential an auto parts shop and my category size is large, with typical categories and vehicle make and model categories. Category count is currently ~2500. I also have 108k product_attributes, if that makes a difference.

Thanks!

Share this post


Link to post
Share on other sites

Hi,

I have a problem when the ajax desactivated in module cart, prestashop 1.6.1.18

quantities are not updated on pages, and cart remains empty,

but when I click and go in the cart is updated...

someone knows this problem?

Share this post


Link to post
Share on other sites
On 10/07/2018 at 8:24 PM, asapho said:

The same exact request is firing 5 times; I compared the query strings in NetBeans and they're exactly the same.

This is weird, this should not happen or only in 5 differents HTML requests... Can you contact me (via addons or jpresta.com) so I can analyse it deeper? Thank you.

Share this post


Link to post
Share on other sites
15 hours ago, tsoful said:

I have a problem when the ajax desactivated in module cart, prestashop 1.6.1.18

quantities are not updated on pages, and cart remains empty,

but when I click and go in the cart is updated...

someone knows this problem?

Hello, contact me throught the support link (depends if you bought on addons or jpresta.com) and I will have a look.

Share this post


Link to post
Share on other sites

Hello,

I installed the module on version 1.6.1.19 and it seems to not work on my homepage. I can't enable it in "page cache - infos". When I click the red switch on/off button, it remains still red. After the very first instalation stats on gtmetrix were A98 (not changed) A88 (raised from 84) and now it does A94 B83 but i am not sure due to its red unchangeable button if the module is working on the homepage.

Also the "page cache - infos" shows just sometimes, even when the showing is enabled in back office and when I enable the cache on other parts on my site it just automatically switch off.

Edited by vajdal

Share this post


Link to post
Share on other sites
4 hours ago, vajdal said:

I installed the module on version 1.6.1.19 and it seems to not work on my homepage. I can't enable it in "page cache - infos". When I click the red switch on/off button, it remains still red. After the very first instalation stats on gtmetrix were A98 (not changed) A88 (raised from 84) and now it does A94 B83 but i am not sure due to its red unchangeable button if the module is working on the homepage.

Also the "page cache - infos" shows just sometimes, even when the showing is enabled in back office and when I enable the cache on other parts on my site it just automatically switch off.

Try to clear the cache in Advanced parameters > Performances. Check URL parameters 'dbgpagecache', it must be equal to 1 to enable the cache.

Page Cache decreases PageSpeed / GTMetrix score in test mode because of the infos box.

For your information: The score indicated by tools like PageSpeed or GTMetrix essentially reflects the design quality of your theme. This helps to know if your site is designed to display quickly, it does not mean that your site is fast. A fast site can have a bad score and a slow site a good score because the TTFB (Time To First Byte) is not taken into account. In other words, the response time of the server does not appear in this score. You have to look at the loading time of the site; PageCache reduces the TTFB, ie the response time of the server of the first request (HTML).

Share this post


Link to post
Share on other sites

I am running version 3.17 and I'm having some issues when customers log in. After they log in and go to another page they are showing they aren't logged in, etc. I'm thinking I need to upgrade the module. Can I upgrade for a discount? Also, what is the difference between standard and ultimate?

Will you help me with my issues once I install the newest version to make sure everything is running properly?

Thanks!

Alex

Share this post


Link to post
Share on other sites

Hi,

 

I just updated to version 4.28 (PS 1.6.1.17). We had some issues with the older version in Multistore.

For some reason the sliders for Pages&Timeouts won't display.

I have to fill in something, but any number (except 0) breaks my website.

 

Any idea how to solve this?

 

Regards,

 

Christiaan

pagecache.jpg

Share this post


Link to post
Share on other sites

Why when deleting the prestashop cache and page cache using "Clear cache" in database there is only `ps_jm_pagecache_mods` cleared but `ps_jm_pagecache` is not cleared? I have like 100 000 entries there. 

Can I delete it manualy when deleting default cache? Or Can You tell me which function exactly is doing this?

Edited by hakeryk2

Share this post


Link to post
Share on other sites
On 08/08/2018 at 2:41 PM, hakeryk2 said:

Why when deleting the prestashop cache and page cache using "Clear cache" in database there is only `ps_jm_pagecache_mods` cleared but `ps_jm_pagecache` is not cleared? I have like 100 000 entries there. 

Can I delete it manualy when deleting default cache? Or Can You tell me which function exactly is doing this?

I'm back from vacation, thank you for your patience.

This table is used for stats. It will be cleared when you clear statistics in Page Cache configuration page > Stats tab.

Share this post


Link to post
Share on other sites
On 07/08/2018 at 6:10 PM, Christiaan_01 said:

I just updated to version 4.28 (PS 1.6.1.17). We had some issues with the older version in Multistore.

For some reason the sliders for Pages&Timeouts won't display.

I have to fill in something, but any number (except 0) breaks my website.

 

Any idea how to solve this?

Try to clear Prestashop cache and also your browser cache (template and JS have been changed)

Share this post


Link to post
Share on other sites
17 hours ago, JPresta.com said:

Try to clear Prestashop cache and also your browser cache (template and JS have been changed)

Hi JPresta,

 

Thanks for helping, but unfortunately it doesn't change the issue.

 

The console gives this error:

ReferenceError: Slider is not defined[Meer info] index.php:4039:13

 

 
Edited by Christiaan_01

Share this post


Link to post
Share on other sites
53 minutes ago, Christiaan_01 said:

Thanks for helping, but unfortunately it doesn't change the issue.

Can you contact me (via addons or jpresta.com) so I can analyse it ?

Share this post


Link to post
Share on other sites
On 7/12/2018 at 8:45 AM, JPresta.com said:

This is weird, this should not happen or only in 5 differents HTML requests... Can you contact me (via addons or jpresta.com) so I can analyse it deeper? Thank you.

 

I apologize for the delayed reply!

I figured it out after understanding how function PageCacheDAO::clearCacheOfObject is called and operates. I had modified the $query SELECT string to clear specific cache objects via CRON and was inadvertently delete all cache when the function was called by pagecache:: with $id_object = NULL.

Oops. My fault, not yours.

Share this post


Link to post
Share on other sites
1 hour ago, YourObsession said:

Hello. After installing the module, I have a problem with the cookie and AgeVeryfi modules. https://mypresta.eu/pl/modules/funkcjonalnosci-sklepu/europejskie-prawo-cookies.html https://addons.prestashop.com/en/website-security-access/19208-ageverify.html. Modules are constantly displayed on every page of the store.

Can you contact me (via addons or jpresta.com) so I can analyse it ?

Share this post


Link to post
Share on other sites

Hi,

 

I got a problem with the module (Page Cache Ultimate, last version 4.2.8). I have a multistore with a condition that redirect non-logged users to authentification page (you need to be logged-in in order to see the shop).

It's working fine, however when I enable the module, users are redirected all the times, even if they are logged-in. It seems that the condition "$this->context->customer->isLogged()" is not working properly in Classes/Controller/FrontController.php when the module is enabled.

 

Here is the condition used:

 

pb.png

Share this post


Link to post
Share on other sites
22 hours ago, Vincent Nguyen said:

I got a problem with the module (Page Cache Ultimate, last version 4.2.8). I have a multistore with a condition that redirect non-logged users to authentification page (you need to be logged-in in order to see the shop).

It's working fine, however when I enable the module, users are redirected all the times, even if they are logged-in. It seems that the condition "$this->context->customer->isLogged()" is not working properly in Classes/Controller/FrontController.php when the module is enabled.

To be compatible with Page Cache, this kind of redirection should be done by a module in actionDispatcher hook and the position in the hook should be before Page Cache. When Page Cache displays the page it removes all customer information in actionDispatcher that's why it is always redirected.

Share this post


Link to post
Share on other sites

Hi,

 I'd like to buy this addon module but before I buy I'd like to ask a few question :

 

1. Is it compatible with warehouse theme?

2. Does it support the custom Prestashop frontpage module that comes with warehouse theme.

3. Does it support special price for different customer group? Because I have different price for different 

customer group would this module allow dynamic info (eg. price for different group) base on their customer

group?

 

Edited by Deddy
Wrong Spelling / typo.. and more explanation

Share this post


Link to post
Share on other sites
6 hours ago, Deddy said:

1. Is it compatible with warehouse theme?

2. Does it support the custom Prestashop frontpage module that comes with warehouse theme.

3. Does it support special price for different customer group? Because I have different price for different 

customer group would this module allow dynamic info (eg. price for different group) base on their customer

group?

1) Yes it is

2) Don't know which module you are talking about but if it is delivered with warehouse theme then it should be compatible

3) Yes, a different cache is done for each customer group

Share this post


Link to post
Share on other sites

Hi, 

I bought the module today......I immediately saw significant improvements in speed .... and I really thank the developer!
But I have a problem: inserting products in the cart when I go in the product categories pages the cart is not updated but remains with 0 products.
On other pages (Product pages, Home Page) instead I see it correctly updated.
How can I solve?
Another request: I tried to do a test with GTmetrix and give me this info (attached image) about the Caching Browser ..... is it possible to do something with the module?

Thank you very much for the help!

Schermata 2018-10-14 alle 23.26.46.png

Share this post


Link to post
Share on other sites
17 ore fa, bssolutions dice:

Hi, 

I bought the module today......I immediately saw significant improvements in speed .... and I really thank the developer!
But I have a problem: inserting products in the cart when I go in the product categories pages the cart is not updated but remains with 0 products.
On other pages (Product pages, Home Page) instead I see it correctly updated.
How can I solve?
Another request: I tried to do a test with GTmetrix and give me this info (attached image) about the Caching Browser ..... is it possible to do something with the module?

Thank you very much for the help!

Schermata 2018-10-14 alle 23.26.46.png

additional information --> I'm using Prestashop 1.7.4.2 and my theme is Aeonmarket Theme (bought in PS Addons)

These are my settings on the "Performance" page
I am not using PS smarty cache because of a problem of displaying the Vertical Menu of the theme (I await solution from the developer of the theme)

Schermata 2018-10-15 alle 17.10.11.png

Share this post


Link to post
Share on other sites
On 14/10/2018 at 11:52 PM, bssolutions said:

Hi, 

I bought the module today......I immediately saw significant improvements in speed .... and I really thank the developer!
But I have a problem: inserting products in the cart when I go in the product categories pages the cart is not updated but remains with 0 products.
On other pages (Product pages, Home Page) instead I see it correctly updated.
How can I solve?
Another request: I tried to do a test with GTmetrix and give me this info (attached image) about the Caching Browser ..... is it possible to do something with the module?

Thank you very much for the help!

Schermata 2018-10-14 alle 23.26.46.png

For the problem with cart you can contact me via the support, I will analyse it.

For GTMetrix, the first one is not an error, this request cannot be cached (may Prestashop could explicitily set 'no cache'). Other requests are externals (Facebook, Google, etc) so you cannot do anything for that.

Share this post


Link to post
Share on other sites

Why don't you add a pre-cache feature to cache automatically all the page of the website?

That would be a very usefull feature to be used combined with clear cache cron. In this way It will be possible to set up 2 cron that clear and regenerate new cache, so user no need to way for slow not cached page.

Share this post


Link to post
Share on other sites
17 hours ago, DARKF3D3 said:

Why don't you add a pre-cache feature to cache automatically all the page of the website?

That would be a very usefull feature to be used combined with clear cache cron. In this way It will be possible to set up 2 cron that clear and regenerate new cache, so user no need to way for slow not cached page.

This kind of feature takes too many time to be done with PHP, the script would be stopped by the server, that's why I recommend to use wget to do it.

Share this post


Link to post
Share on other sites
16 hours ago, DARKF3D3 said:

Thank you Kpresta, do you have a guide on how this can be be done using wget?

Here is a command you can use (change values depending on your site:

wget -r -D www.yourshop.com -l3 -P temp -x -R "*cart*","*order*","*yourtheme*" -nd --delete-after --output-file=log.txt --no-verbose https://www.yourshop.com --no-check-certificate

 

Share this post


Link to post
Share on other sites

That command it's used only to add all pages to cache or it's used also to clear cache?

I have to replace 2 "yourshop.com" with my shop url? It's correct that the first one has only www and the second one also https://?

Share this post


Link to post
Share on other sites
On 25/10/2018 at 11:25 PM, DARKF3D3 said:

That command it's used only to add all pages to cache or it's used also to clear cache?

I have to replace 2 "yourshop.com" with my shop url? It's correct that the first one has only www and the second one also https://?

Yes, the first one defines the domain, the second one the URL to browse. You should also change 'yourtheme' value with the name of your theme (ex: warehouse).

It only browses the site so to clear the cache you must call the CRON URL before.

Share this post


Link to post
Share on other sites

Thank you.

Where can be found log.txt created by this script?

this script will only find pages linked from other pages of the website starting from home? So for example if there's some pages that have no link to it this page will not be opened?

I'm wondering this because on my website there's some OOS products no more showed on categories, and the only way to find them it's using direct link, but there are some user arriving on these products from search engine, so that would be a good thing to cache also these pages. There's a way to do this?

Share this post


Link to post
Share on other sites
8 hours ago, DARKF3D3 said:

Where can be found log.txt created by this script?

this script will only find pages linked from other pages of the website starting from home? So for example if there's some pages that have no link to it this page will not be opened?

I'm wondering this because on my website there's some OOS products no more showed on categories, and the only way to find them it's using direct link, but there are some user arriving on these products from search engine, so that would be a good thing to cache also these pages. There's a way to do this?

log.txt is in the directory from which you ran the script

That's true, if a page is not linked by other pages then it is not cached. The only way would be to generate a list of OOS products and give it to wget (don't ask me how to generate this list ;-)).

 

Share this post


Link to post
Share on other sites

I would like to start the module from the beginning. I want to clear all the cache files from the server, but I can not do this from the settings in the module. Files are not deleted from the server. I press the "Clear cache" button, but the files on the server are getting more and more. How can I delete all the files created by the module and start from the beginning?

I'm talking about files on screenshot below. 

2018-11-21_09-43-49.png

Share this post


Link to post
Share on other sites
2 hours ago, Lupus21 said:

I would like to start the module from the beginning. I want to clear all the cache files from the server, but I can not do this from the settings in the module. Files are not deleted from the server. I press the "Clear cache" button, but the files on the server are getting more and more. How can I delete all the files created by the module and start from the beginning?

I'm talking about files on screenshot below. 

2018-11-21_09-43-49.png

Page Cache only creates files under /cache/pagecache, when you clear the cache it is deleted.

cache-- and cache--- are probably backups and will never be cleared (except manualy), img is the directory where images of products (and others) are stored, it will not be clear with cache.

Normally, clearing the cache from the Performance page should be enought.

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