Page 3 of 3

Re: [RELEASED] Page Cache for Opencart 1.5.X

Posted: Wed Nov 12, 2014 10:18 am
by budgetneon
Cue4cheap wrote:budgetneon,

Would it be possible to have it just delete the expired cache files? I looked at the admin side and it said it had 1,xxx expired files. Seems like a bit of extra space that just should go away versus staying around if they are expired. (I deleted them without writing down the exact amount of files or the space it was taking).

Thank you,
Mike
PHP doesn't provide a way to schedule and run jobs in the background. So, to do what you're asking for, I would have to wait until a visitor came to the page, and then run the deletion while they are waiting for their page. That didn't seem like a wise feature to put into a product that is supposed to IMPROVE website performance :)

Most hosts allow you to schedule your own jobs...there's probably a Cpanel control for "cron". Add a job like the following, and have it run twice a day or so:

find /opencart/root/dir/system/cache/pagecache -type f -cmin 300 -exec rm -f {} \;

That finds any files in the cache directory and deletes them if they are over 300 minutes ( 5 hours ) old.

Re: [RELEASED] Page Cache for Opencart 1.5.X

Posted: Fri Nov 14, 2014 7:56 am
by Cue4cheap
Cool - I'll give that a shot.

Thank you,
Mike

Re: [RELEASED] Page Cache for Opencart 1.5.X

Posted: Sun Nov 16, 2014 12:40 am
by Cue4cheap
budgetneon wrote:
Most hosts allow you to schedule your own jobs...there's probably a Cpanel control for "cron". Add a job like the following, and have it run twice a day or so:

find /opencart/root/dir/system/cache/pagecache -type f -cmin 300 -exec rm -f {} \;

That finds any files in the cache directory and deletes them if they are over 300 minutes ( 5 hours ) old.
I had to add a + in front of the minutes to have it work for us.

find /opencart/root/dir/system/cache/pagecache -type f -cmin +300 -exec rm -f {} \;

Thank you for the script, info and cron command.

Mike

Re: [RELEASED] Page Cache for Opencart 1.5.X

Posted: Sun Nov 16, 2014 3:32 pm
by Tania201
Sometimes hosting companies don’t allow you to set up a cron job. EasyCron.com is a free and easy way to set up crons and have control over them.

Re: [RELEASED] Page Cache for Opencart 1.5.X

Posted: Sat Jan 03, 2015 11:51 pm
by budgetneon
Updated version 1.0.5. Added more docs for charset and locale, added missing logic for http response that could have caused 404 pages to be cached.