Post by budgetneon » Wed Nov 12, 2014 10:18 am

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.

New member

Posts

Joined
Sat Sep 20, 2014 11:32 pm


Post by Cue4cheap » Fri Nov 14, 2014 7:56 am

Cool - I'll give that a shot.

Thank you,
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Cue4cheap » Sun Nov 16, 2014 12:40 am

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

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Tania201 » Sun Nov 16, 2014 3:32 pm

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.

Newbie

Posts

Joined
Tue Jan 14, 2014 9:55 pm

Post by budgetneon » Sat Jan 03, 2015 11:51 pm

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.

New member

Posts

Joined
Sat Sep 20, 2014 11:32 pm

Who is online

Users browsing this forum: No registered users and 45 guests