PDA

View Full Version : Caching Plugin


Ollie
30-07-09, 11:38
Hi guys.

I have been experimenting with a new caching script to improve the performance of the ShopWindow Client Software. It should reduce the number of calls to the API and increase the speed of your client.

I would be keen if a few of you would try it out and give some feed back. I would be interested to know how your quota changes as a result of implementation and what the disk usage is like (how much space the cache dir is taking up).

Its pretty simple to implement and should require minimal effort on your part.

The two files required are attached in a zip file

To setup please follow the following steps:
Step 1) Upload the file class.soap_cache.php to your /classes directory.

Step 2) Rename your class.soap_client.php file to class.soap_client_backup.php (just rename back if anything goes wrong)

Step 3) Upload the file class.soap_client.php into your /classes directory.

Step 4) Add the following lines to your constants.inc.php

/**
* Site Cache (Seperate to smarty cache, which we suggest you activate as per documentation)
*/
define('CACHE_ENABLED', true);
define('CACHE_LOCATION', './cache/');
define('CACHE_LIFETIME', 3600);

Step 5) Create a directory called 'cache' in the same directory as your index.php and constants.inc.php files.

Step 6) Modify the permissions on the cache directory to be 0777 (Many FTP clients let you change the properties by right clicking and selecting preferences).


Probably worth noting, the caching class has built in garbage collection (meaning old cache files are removed) and as far as i know, will not affect the performance of your site in a negative way. I also suggest you take a full copy of your site before touching any files to aid backup.

Feedback appreciated.

Cheers

Amoochi
31-07-09, 10:50
I'll upload this and give it a go at some point today, but i'm not sure it will work at all though, as when I first installed version 2 of the software, we had some real issues with the caching bits and ended up with me being told by Ollie to remove certain caching bits to get it all working on my server, which of course worked, but it may have implications regarding anything else I try caching wise.

Anyway, we'll find out at some point today, hopefully it will save some calls and will speed things up for me. :)

I'll be trying it on Amoochi first, if it works, then i'll add it to Total Format.

amcho
31-07-09, 12:40
I assume this only applies to version 2 websites?
unfortunately most of my websites are still running version 1,
but I'll also give it a go on my version 2 website and report back...

amcho
31-07-09, 13:25
implemented on one of my version 2 sites - all seems to be working Ok - the cache folder is getting filled up with lots of stuff - I think it is runnig a bit faster - but not obvously so....