Jump to content

[Free Module] Xtreme cache


Recommended Posts

  • 2 weeks later...
  • Replies 206
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Xtreme cache module hooks into actionDispatcher and tries to serve the full page html before Prestashop processes it. The cache source is built upon previous requests, before sending it to the browser

work for prsta 1.7?

@TiendasPS I posted on Github to encourage peer-reviewing. The code is really simple, everyone with a basic PHP knowledge can understand it. @Trip I use it on my website: http://spagro.it/shop: open

Posted Images

Hello,

 

Thanks a lot Simone for the module, I will test it on prestashop 1.6.1.1.

 

But before just a simple question: when I download and install the 1.0.6.fixed version, it is named 1.0.5 version on prestahop. Is it normal? Is it an oversight or do I have an the old version (despite I clicked on 1.0.6.fixed) ?

 

Thank you

 

Axel

Share this post


Link to post
Share on other sites
  • 2 months later...

hi (ps 1.6.1.1)

I would like to use this modul (1.0.6.fixed version).

What is a performance setting?

I installing it, but it nothing work, not understand why?

More and more seeing this topic.

thx :wub:

Share this post


Link to post
Share on other sites

@mrbatyo Did you get any error on install? If not, you can add some debug printing to see what's happening: if it is active, if the cache entry is not NULL...

Consider that you have to NOT be logged in and your cart MUST be empty to see it working.

Share this post


Link to post
Share on other sites

@mrbatyo Did you get any error on install? If not, you can add some debug printing to see what's happening: if it is active, if the cache entry is not NULL...

Consider that you have to NOT be logged in and your cart MUST be empty to see it working.

hi,

thx fast reply message.

when install xtreme chache correct version modul and not get it  error. PS dev mod is aktiv, and not get error.

-using aktiv custumer,

-without custumer,

-full cart,

-empty cart

but nothing happens

 

this is my site: led-agent.hu (now opening and testing at the moment)

 

(should be to using me something an my server, for example xcahce)

 

thx

:)

Edited by mrbatyo (see edit history)

Share this post


Link to post
Share on other sites
  • 1 month later...

Hello Simone

 

great module. I only have problem with one page checkout, because it somehow change the css and at the end it is only one coloumn, but is should be 2  or 3 coloumn.

 

Do you have any suggestion how to correct this?

 

here is the link to my site: https://www.trgovina-figura.si/si/module/supercheckout/supercheckout.html

and of coures add some product in cart :)

 

Martin

 

 

Share this post


Link to post
Share on other sites
  • 1 month later...

Hello Simone

 

new version isn't working well because after install  (prestashop ver 1.6.1.4) you cant access to modules section. After I deleted folder with xtrem cache everything is back to normal.

 

best regards

Martin

Share this post


Link to post
Share on other sites

Hello Simone,

 

As i can see you are using PHP fastcache functions inside your module. That is great. Looking at the new files and structure of PHP fastcache I was wondering if it's possible for you to check if their are performance plus possible. If so, can you incorporate the new PHP fastcache structure inside your Xtreme cache module.

Thanks

Peter.

Share this post


Link to post
Share on other sites

this is in log file

[10-May-2016 16:50:47 Europe/Ljubljana] PHP Fatal error:  Class 'PDO' not found in /home/xxxxxxxxx/public_html/demo/modules/xtremecache/vendor/phpfastcache/3.0.0/drivers/sqlite.php on line 61
[10-May-2016 14:51:15 UTC] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/xxxxxxxx/public_html/demo/classes/db/MySQL.php on line 51
[10-May-2016 16:51:16 Europe/Ljubljana] PHP Fatal error:  Class 'PDO' not found in /home/xxxxxxx/public_html/demo/modules/xtremecache/vendor/phpfastcache/3.0.0/drivers/sqlite.php on line 61
 

 

and this is what I get when I turn PS_MODE_DEV to true

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/xxxx/public_html/demo/classes/db/MySQL.php on line 51

Fatal error: Class 'PDO' not found in /home/xxxxxx/public_html/demo/modules/xtremecache/vendor/phpfastcache/3.0.0/drivers/sqlite.php on line 61

 

best regards

 

Martin

Share this post


Link to post
Share on other sites

@malcek You're not using v2.0.0 since it doesn't uses phpfastcache. Still, the error occurs because of the pdo extension missing: you can solve this by switching to filesystem cache (look for a DRIVER option in the module file).

Share this post


Link to post
Share on other sites

[PrestaShop] Fatal error in module file :N:\www\prestashop\modules\xtremecache\xtremecache.php:
Arrays are not allowed in class constants line 19

 

This is the error which I am getting after trying to install it on 1.6.1.4 and after that when I try to go to modules section in back office I am seeing this one 

 

I am not able to go to BO until I manually delete the module folder from modules.

 

EDIT----------------------------------------------------------------------------------------------------------

 

This message was showing because of PHP version older than 5.6. When I update PHP version, installation went ok ... but in BO I am getting all the time this error

 

Notice: Trying to get property of non-object in N:\www\prestashop\modules\xtremecache\xtremecache.php on line 118

 

I have another question - so if this module use internal prestashop cache system so what options should be enabled in BO -> Advanced Parameters -> Performance and "Caching" section supposed to be on or off?

 

I am asking because after installation I checked loading times with developer tools and nothing changed.

Edited by hakeryk2 (see edit history)

Share this post


Link to post
Share on other sites

@dmr-electronics Version 2.0.0 stopped using Fastcache: it uses Prestashop's native cache instead.

 

Well Simone,

 

maybe its a good idea to look and test the new PHP fastcache, when incorporate in Xtreme-cache prestashop module.

 

Hope you find time to do so.

 

Thanks 

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Hi All,

 

I just installed and when enable, our site come up as "The thatsallnatural.com page isn’t working - HTTP ERROR 500". Dose any one else have the same problem or is there a way to fix it?

 

Natebc

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...
  • 1 month later...
  • 3 weeks later...

ma cerca di essere più preciso se vuoi dare un contributo sennò statt a cas

ma si può sapere quale si deve scaricare? hai messo 10zip mi hai fatto incasinare il sito, meno male che ho fatto un backup

Share this post


Link to post
Share on other sites

When I download from github I get a version 1.0.5 or 6...

 

And it matter of fact those versions appear slower than my native noncached version. I'll test today further but yesterday those were my results.

It's true me too not have understand which version I must download...

Share this post


Link to post
Share on other sites

Sorry, Please create public_html/modules/xtremecache/xcache/vucumbracom/ and SET Mode 0777 or any Writable Permission!

 

ho settato la cartella in 777 ma niente

Simone puoi essere più chiaro su

-cosa si deve installare( che versione)

-Come si installa

-Come funziona,

-nei moduli non è presente( lo caricata via ftp)

Edited by vucumbra (see edit history)

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hi

where can we download your last release to evaluate it ?

nothing new on github

thanks for your reply

the author not answer, I have too ask some question becouse from me not work

Share this post


Link to post
Share on other sites

@vucumbra

 

 - il modulo in sè è il file xtremecache.php

 - config.xml viene generato da Prestashop quando installi il modulo, quindi non è obbligatorio caricarlo

 - override/classes/controller/Controller.php introduce un nuovo hook per salvare una copia della pagina nella cache

 - override/controllers/admin/AdminPerformanceController.php permette di svuotare la cache tramite il pannello di amministrazione

 

Il modulo funziona in automatico, basta che sia attivo.

Share this post


Link to post
Share on other sites

nella cartella override ci sta solo tremecache\override\controllers\front\FrontController.php

gli altri file che dici non ci sono...

non so è la prima volta che non capisco come installare un modulo, ok che non sono esperto...però qui è davvero poco chiaro

vabbè fa niente

Share this post


Link to post
Share on other sites

Hi, it takes time to cache the visit site. You can check in module/Xtreme cache/xcache if the cache is loading. Alternatively for fast growing cache is to create a cron job for your sitemap XML files.

So my advice take 24 hour rest and check after that.

Share this post


Link to post
Share on other sites

Hi, it takes time to cache the visit site. You can check in module/Xtreme cache/xcache if the cache is loading. Alternatively for fast growing cache is to create a cron job for your sitemap XML files.

So my advice take 24 hour rest and check after that.

thx for quick answer

but i have not understand if i have just upload the file FrontController.php in override folder

or

i must install the module

Share this post


Link to post
Share on other sites

Please help becouse my site is down!
i have installed this module! Then the site was down.....Then i have removed the module manually by ftp , and now the site work

but Is correct remove this module manually? I have to do something else?

 

It's too hard for me understand this module i want remove and stop, i not know if now this module have override something other file....

 

how remove this module?

Share this post


Link to post
Share on other sites

this i have if i upload this module in module folder....

 

[PrestaShop] Fatal error in module file :/home/vucuzcax/public_html/classes/cache/Cache.php:
Class 'CacheXcache' not found

Share this post


Link to post
Share on other sites

Hi do not use 2 cache systems, i checked your site and i see alot of js scripts on top of page.

 

and yes you need to install the module with your admin backoffice 

 

and did you set the performance parameters in advanced/performance section of your admin 

 

if you code is clean and you have all nice set up including installing xtreme cache you can get below performance.

 

On a shared hosting i have:

 

 

Performance Scores
PageSpeed Score(98%)
YSlow Score(83%)
Page Details
Page Load Time2.5s
Total Page Size366KB
Requests31

Share this post


Link to post
Share on other sites

@vucumbra How to use:

 

 - install module uploading via zip / FTP

 - via FTP, open /root/override/classes/controller folder

 - if there's no FrontController.php file, just copy that in the module's folder

 - if there is such file, open it and merge the content from the module's one

 - delete the /root/cache/class_index.php file

 

Post your site here so I can check if it's working.

Share this post


Link to post
Share on other sites

i have followed the path from module and is
xtremecache\override\controllers\front

and not

root/override/classes/controller 

 

......

 

but ok i have do it how you have say 

i have :

-installed module

-copy the file FrontController.php  in root/override/classes/controller ( becouse There was not)

- and i have deleted /root/cache/class_index.php file

 

my site is in my signature www.vucumbra.com

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Ok guys

 

i'm testing release 2.0

it seems that the file FrontController.php in the package should be in Override/Controllers/Front

is it the right place ? because a few of you are speaking about override/classes/controller witch is quite different ....

 

Thanks to clarify ...

Share this post


Link to post
Share on other sites
  • 1 month later...

Hi guys!

 

I`m also trying to get working Xtreme cache module .. but no luck :(

in beginning when install module i get error: need create "xcache" folder, so i create folder and then module buy self create .htacess and "sqlite" folder

 

no more errors but also nothing caching :(

 

please help!

Share this post


Link to post
Share on other sites
  • 1 month later...

After installing that one from github, i see 1.0.5 as version. I renamed the 1.0.6 by renaming the original one to 1xxxx.cache and removing the 106 from the other one. Is this correctly done?

 

It seems working, my Pagespeed in a seobility check changed from 0,9 to 0,12

 

Great Work!

Share this post


Link to post
Share on other sites

Whe i use this tool, i have the problem, that in one session appears often the cookie-acceptance-window. Whe a logged -in user logs out this message appears every time, then again, when the page is refreshed in home-mode.

 

Has someone else the same problem and a soultion? I want use that cache-module, because it speeds up my page very good. At the moment i deactvated it, because these cookie messages decrease the usability of the site extremely.

 

I found out, that the site works properly after a reset of the xtremecache-module. Is there a way to define/create a cronjob that does that job? I tried to start that link to reset with a cronjob, but this won´t work, the files remain in the cache folder.

Edited by Claudiocool (see edit history)

Share this post


Link to post
Share on other sites

okay, it doesn´t work fine, the dirty solution wit deleting the files in the cache folder by resetting the xcache works only a few minutes without errors. After that few minutes the Frontoffice kicks the sessions and logs the users out, after that the user sees the cookie-message.

 

The module itself speeds up the shop, but with that buggy function i cannot use it, has anybody a solution for this?

Share this post


Link to post
Share on other sites

The solution is by Express cache I did a while ago. And this cache tool really works.

The tool from Simone is in basic a good one but Simone needs to dive deep inside the module to fix all problems with cache. Running on a full operational website with other modules is not advisable. The only mod what is working is Express cache.

 

Sorry.

Share this post


Link to post
Share on other sites

Maybe you are right, but i think, i'll wait for other statements. I'm not so familar in php-coding, but i think, this problem can be solved and xcache becomes a good mod. I use a fast server, so it's not really urgent to solve this problem.

Share this post


Link to post
Share on other sites

@Claudiocool How often have you found you need to reset the module?

Hi Simone,

 

after i found out the problems with the sessions und the log-out i've deleted the 2 files in the cache-folder. After that it worked fine. But after a couple of klicks on the page the effect returned.

 

My first idea was to delete the files periodically by a cronjob, but after i had seen that the mistake returned soon after deleting, i think, there must be another way to find the problem.

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...

@Claudiocool I don't work much on Prestashop anymore. If you have a minimum of programming skills, it should be really easy to adapt or even implement by yourself this module. The workflow is as simple as:

 

  1. Hook into the first available hook
  2. Create an hash of the request (maybe url + language +  shop)
  3. If you have a cached copy, serve it else continue
  4. Hook into the response sending (you may have to create a custom hook)
  5. Create a hash of the request and cache the response (in the filesystem, in DB, in Memcache...)
  6. Done

Maybe someone else in the community will spend a minute to do so and release it.

Share this post


Link to post
Share on other sites

Why not? If it works without problems and don't makes any trouble ;)

 

-The modul should work without making trouble with the advancedeucompliance (the built-in cache causes some translation-problems and show the delivery time twice in the frontend)

-Logged-in customers won´t be thrown out

-Cooke settings of the browser must be kept (otherwise the cookie message is shown every site refresh)

-The items on stocks must be buyable (no message shown, that the item is out of stock)

 

If you can realize the cache-module fine working (we can test ist together in my shop, and don´t be afraid, you´ll get your money)

 

My Shop-Version is 1.6.1.7 and i use it on a php 7.017 with nginx-proxy and OpCache running.

 

Cordiali saluti da Claudio ;)

Edited by Claudiocool (see edit history)

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...

I am on a server running php 5.5 and I have an issue due to constant arrays and not working in php 5.5

 

[PrestaShop] Fatal error in module file :/var/www/vhosts/powertex.co.uk/httpdocs/modules/xtremecache/xtremecache.php:

Arrays are not allowed in class constants

 

Is there a workaround at all?

 

Thanks

Share this post


Link to post
Share on other sites

@alexmercenary replace empty arrays with empty strings ("") and replace isNotExcluded function with the following:

private function isNotExcluded($id, $pool)
    {
        if (is_string($pool))
             $pool = explode(", ", $pool);

        return array_search($id, $pool) === false;
    }

Share this post


Link to post
Share on other sites

@Simone Salerno unfortunately I'm still getting errors.

 

Thank you for the response. Errors on Module page are below. Not very explanatory but it's all it gives me.

 

  1. xtremecache (parse error in /modules/xtremecache/xtremecache.php)
  2. xtremecache (class missing in /modules/xtremecache/xtremecache.php)

Share this post


Link to post
Share on other sites

@Simone Salerno ok now it's showing me an error on a blank page:

 

[PrestaShop] Fatal error in module file :/var/www/vhosts/powertex.co.uk/httpdocs/modules/xtremecache/xtremecache.php:
syntax error, unexpected '*', expecting ',' or ';'

 

These error logs are pretty weak.

 

I have to say the more I deal with Prestashop the more I realise how terrible it is I should have stuck with Magento.

 

This has nothing to do with your great module and everything to do with the amount of troubles I have had repeatedly with it.

Share this post


Link to post
Share on other sites

Hey @Simone Salerno I think I have it working now thank you for your help!

 

There are no errors and it says installed. Is there anything else you have to do to enable it?

Can I verify that it is definitely running? Is there any output anywhere which I can check?

 

Thanks again

Edited by alexmercenary (see edit history)

Share this post


Link to post
Share on other sites

Be sure to transplant it in positions displayHeader and actionResponse.

To check if is running, view the source of your front page (in Chrome is Ctrl+U) and you should see 

<!-- cached on ... -->

at the very beginning (you may have to refresh the page a couple of times - be sure to be logged out).

Share this post


Link to post
Share on other sites
  • 5 months later...
  • 3 months later...

I have installed latest version from:
https://github.com/SimoneS93/xtremecache

I had to change name of xtremecache 1.0.6.php to xtremecache.php before installation and create "xcache" folder in module folder with 777 permission.

After that module seems to work only in one of 2 multishops. I can see "opened from cache" at the beginning of web page 

Share this post


Link to post
Share on other sites
  • 1 month later...

Greetings,

 

Thank you very much for your great and free module @Simone Salerno giving us the opportunity to speed up our websites without having to buy expensive modules.

I have installed the module recently on a PS 1.6.0.14 plateform.

Like the above poster, I installed the module with the xtremecache 1.0.6.php file and everything seems to we working just fine so far.

But out of curiosity, I was wondering, is the xtremecache.php file in root of the zipped folder supposed to be used on PS 1.6.0.14 or is it just for PS 1.6.1 + version?

Also is there an easy way to clear the cache to force its renewal?

For example by calling a purposely made emptycache.php file we could make in the module folder or any other ways?

 

Thank you very much.

Regards,
 

Share this post


Link to post
Share on other sites

Tyvm for the fast reply @Simone Salerno.

Well I kind of found an easy way way to keep my cache updated on daily basis by having the TTL set to 24h < and having a cronjob to browse my entire website every 24h to warm up and renew the cache at night.

My performance boost is quite noticeable:

NO CACHE
Number of page fleched 885
real    5m51.614s
user    0m38.030s
sys     0m16.760s

FIRST PASS CACHING ALL PAGES
Number of page fleched 885
real    6m32.254s
user    0m37.000s
sys     0m17.300s

SERVING CACHED PAGES
Number of page fleched 885
real    2m53.290s
user    0m37.120s
sys     0m15.480s

 

So MANY MANY thanks to you @Simone Salerno for this great FREE MODULE. Even if you did this years ago, it can still be useful to some people ;) 

I know my PS version is pretty outdated now (PS 1.6.0.14) but you know what they say, "when it works, don't fix it". And I already know that even if I will update at some point, I will not leave the 1.6 branch.

During my tests with Xtremecache 1.0.6 (from GitHub), I wanted to compare the performance with different engines by changing the DRIVER const in the xtremecache.php file to 'files' for example or any other engine supported by phpFastCache v3.0.0, but it did not seem to have any effect at all, it kept making the sqlite folder and db. And yes I uninstalled/reinstalled for my changes in the file to take effect.
Not sure I can change the engine in that version of the module.

One very last thing if you don't mind, I was wondering for what version of PS the default Xtremecache.php in the zip, labelled as v1.0.0 is supposed to be used with? I quickly checked the code and from what I could see, it does not seem to use phpFastCache anymore but the cache system from PS itself, but I may be wrong.

I am already very happy with what I got as result here, but I am just wondering if I am using the right version of Xtremecache for my PS version.

Anyway thanks again for your module and big up!

 

Regards,

 

Share this post


Link to post
Share on other sites

It appears you disabled the ability of choosing the driver to use, likely because sqlite was giving you the best results I assume. Yet I still wanted to test others compatible with my hosting solution :)

So I just made this very obvious edit to the original script to test with 'files' engine. I just share this edit here in case anyone else would feel like testing too:

--- xtremecache 1.0.6.php       2017-04-15 07:41:38.000000000 +0000
+++ xtremecache.php     2018-04-17 11:20:45.752488415 +0000
[spam-filter] -14,12 +14,12 [spam-filter]
      * Cache Time-To-Live in seconds
      * Since cache gets cleaned quite often, use a very high value
      */
-    const CACHE_TTL = 999999;
+    const CACHE_TTL = 82800; //23h

     /**
      * Cache driver
      */
-    const DRIVER = 'sqlite';
+    const DRIVER = 'files';


[spam-filter] -171,7 +171,7 [spam-filter]
      */
     private function getFastCache() {
         phpFastCache::setup('path', __DIR__.DS.'xcache');
-        return phpFastCache('sqlite');
+        return phpFastCache(static::DRIVER);
     }

     /**

I also set TTL to 23h so I can easily refresh my whole cache every 24h during the night and low usage time of my website.

For me it strangely seems that I am getting slightly better results with the 'files' engines, but as usual, what might be better for one, might not be for someone else. Just test it out by yourself and see what suits you the best hehehe ;)

Thanks again from this great module which greatly improves old PS versions with just a single module addition! Is not that great?

 

Hope this helps,

Share this post


Link to post
Share on other sites
3 hours ago, Soyons zen said:

Hi, I just installed bug on my home page Ps 1.6.1.18

what is the right module to install ? Thank you
 

 

Hello @Soyons zen,

Normally for your version of PS you should use the latest version released by the OP which you can get from the first post of this thread. Note it has not been tested by himself for version above PS 1.6.1.12 as per his own words, but I am pretty sure I have seen others saying it was working on PS versions above that.

Just a quick thought - if you have installed the right version -, have you deleted website/cache/class_index.php file after installation?

Because of the overrides used by this module, this is needed or you will get a blank page.

 

Hope this helps,

Share this post


Link to post
Share on other sites
1 hour ago, Muad'Dib said:

 

Bonjour @Soyons zen ,

Normalement, pour votre version de PS, vous devez utiliser la dernière version publiée par l'OP que vous pouvez obtenir à partir du premier message de ce sujet. PS 1.6.1.12 a ses propres mots, mais je suis assez sûr d'avoir vu d'autres personnes dire qu'il travaillait sur les versions PS ci-dessus.

Juste une petite idée - si vous avez installé la bonne version -, avez-vous supprimé le fichier site / cache / class_index.php après l'installation?

En raison des remplacements utilisés par ce module, cela est nécessaire ou vous vous demandez une page vierge.

 

J'espère que cela t'aides,

 

 

Hi, thank you, yes I delete the class_index.php, I will redo a new installation I will let you know

Edited by Soyons zen (see edit history)

Share this post


Link to post
Share on other sites

Sorry to hear this... :(

I am not sure I can try to help you any further since my PS version is much lower than yours (PS 1.6.0.14) and there were serious changes starting 1.6.1+.

However if you want to get help from other people maybe reading this thread you will need to provide them with more debug details.

What do you see as error when you turn your website in dev mode by setting to true the following var in config/defines.inc.php:

define('_PS_MODE_DEV_', true);

They will also need the php version your are running on your host.

 

Hope this helps,

Share this post


Link to post
Share on other sites