Page 1 of 1

quick cache garbage collection question

PostPosted: August 11th, 2010, 11:46 am
by sephage
Hi - thanks for the plug-in, really enjoying it!

I've got a quick question on when the /wp-content/cache/ directory gets flushed / cleaned up. My Expiration Time on the cache is set to 900 seconds, and the /wp-content/cache/ directory seems to have quite a few files building up in it that obviously are not deleted after 900 seconds.

Is the garbage collection done at some other interval?

Thanks!
-Joe

Re: quick cache garbage collection question

PostPosted: August 12th, 2010, 1:09 pm
by sephage
After 24 hours, there are 830+ files in the /wp-content/cache/ dir.

I suppose I could manually flush these out but if I have to do that then I'll need to go with another plugin :-(

Re: quick cache garbage collection question

PostPosted: August 12th, 2010, 1:36 pm
by sephage
Never mind... I'm just now realizing that it's probably an issue with wp-cron (duh...) and so will troubleshoot that first.

DOH!

Re: quick cache garbage collection question

PostPosted: August 12th, 2010, 7:02 pm
by sephage
Ok... maybe I am just talkin' to myself here but...

If I kickoff wp-cron.php manaully, it works like a charm and cleans up everything, runs other wp-cron jobs, etc.

If I schedule cron in Linux to kick off wp-cron.php manually, it also works.

Since wp-cron relies on hits to web pages to run, is it possible that Quick Cache is so good at caching my site that it prevents any php on the site from being run, and therefore wp-cron never gets kicked-off?

I.e., could it be the case that my site is not getting sufficient dynamic traffic; WP Cron needs visitors who request pages that aren’t cached. It’s unlikely, but if every single page on the site is cached then there’s a chance no PHP will execute?

Re: quick cache garbage collection question

PostPosted: August 13th, 2010, 9:13 pm
by w-press
I have the same problem. How did you edit the cron.php? Can please you share it?

My wordpress is the version 3.01.

I don't know if you have noticed that but it is also impossible to set "None (Wait For Garbage Collector To Handle It"
at Dynamic Cache Pruning settings.

Re: quick cache garbage collection question

PostPosted: August 14th, 2010, 9:11 pm
by sephage
Well, I setup a Linux Cron job (using GoDaddy's hosting control panel) to "manually" run wp-cron.php every 15 minutes. However, what I found was that this doesn't totally work, and for some reason some of the QC cache files are "abandoned" and never cleaned up (unless you delete them yourself).

So for now I've been kind of forced to abandon Quick Cache and go back to using WP-Cache, which isn't as easy to use and isn't as fast, but doesn't rely on wp-cron.php for its cache cleanup.

Still no word back from GoDaddy on the issue that might be preventing wp-cron from running. All I do know is that manually running it works, and reinstalling WP 3.0.1 doesn't help.

Re: quick cache garbage collection question

PostPosted: August 15th, 2010, 12:13 am
by w-press
You run "wp-cron.php" as far as I understand. I think that it is not the correct command and don't understand how it cleans up the cache. You (and me) should run another command/action to delete the garbage.

I have installed http://wordpress.org/extend/plugins/wp-cron-dashboard/ and am able to see all of my pending cron jobs and their times. I see that QC adds a garbage collection job to the cron every 1 hour successfully. It adds "ws_plugin__qcache_garbage_collector__schedule" as a cron job. But "ws_plugin__qcache_garbage_collector__schedule" can not delete the garbage files.

You can still use QC since Godaddy allows a very big disk space and QC is deleting the garbage and serving a fresh copy when the page is visited after it expired. So, garbage collection doesn't have an issue of freshness if you have an enough disk space. My hosting is much faster than Godaddy hosting but it allows me only 500mb. So, I can't continue with QC with thousands of cached files. I should change my hosting package with a bigger plan at my current provider or move to a cheap hosting like godaddy or hostgator just for only QC.

I tried wp-cache, super cache and w3. All of them have some problems. In fact we really don't need a cache plugin if we optimize our sites and use a fast server. I optimized my wp site and use a very fast hosting but still I can't rely on any shared hosting for a stable high performance and can't rent a VPS due to the lack my of server management knowledge and budget restrictions.

Re: quick cache garbage collection question

PostPosted: August 15th, 2010, 8:23 am
by sephage
The file to execute is "http://www.yourwebsite.com/wp-cron.php" - it is supposed to be called whenever someone visits a page on your blog (a non-cached version). My understanding is that QC puts a job into wp's cron schedule which performs the clean-up.

Theoretically, even if wp-cron.php is not being called for some reason, when executed manually it should run any waiting jobs that have passed their scheduled execution time in wp's cron list. But even when it executes (what I believe to be) the QC clean-up job, some of the old cache files never get deleted - which looks like a potential bug in QC maybe.

Re: quick cache garbage collection question

PostPosted: August 24th, 2010, 9:36 am
by Jason Caldwell
Hey guys. Just wanted to chime in here.

I've NOT been able to reproduce a bug in Quick Cache that would cause this behavior. If one of you could please post a list of the files that are NOT being cleaned up, that may help us troubleshoot for you.

Otherwise, you might want to have a look at your file permissions. It's possible that a cron job being run on the server, is being run as a user without permission to delete those files. In other words, your self-created cron job might not be working at all. If the user running the cron job has insufficient permission to delete cache files, it would fail.

* NOTE: Quick Cache self-refreshes it's cache, even without a garbage collection routine. The garbage collection routine is only needed to cleanup cache files on pages that have not seen any traffic for a long time, or that may have been deleted from your database completely.

Re: quick cache garbage collection question

PostPosted: February 3rd, 2011, 11:18 am
by james
Same issue here. Sent you message with more details. Just trying forums also to see if there was a solution.

Re: quick cache garbage collection question

PostPosted: February 4th, 2011, 1:30 am
by james
A temp way to reduce the # of files incrementing is to increase the Cache Expiration Time. I've set ours to one week and instead of 5000 files after a 3 or 4 hours its at 2000 after 10 hours.

But would prefer garbage collection to purge correctly so I can set expiration back to lower value.

Re: quick cache garbage collection question

PostPosted: February 7th, 2011, 2:03 pm
by james
nevermind that did not work.

Re: quick cache garbage collection question

PostPosted: February 13th, 2011, 2:17 am
by davepoobond
i am having a similar problem with the garbage collection.

the auto-expiration does not seem to happen at all. The only time it'll clear out all the files that are in the cache are when i click the "clear cache" button in the top right.

When i try to see the permissions for cache folder, it doesn't allow me to change the permissions and is "owned by nobody." It is locked in a 755, and i can't delete them through ftp.

ive also tried changing "cache" to "cache1" only to see another "cache" folder created, i'll guess by the quick cache plugin, and unable to change the permissions on that one either.

it seems that quick cache likes to make folders that aren't owned by anybody...

as a result, i'm guessing that the auto-expiration isn't able to delete anything because it doesn't have proper permissions. But i don't understand why that would be different than me simply clicking the "clear cache" button.


any help? Also, now i'm stuck with a "cache" and a "cache1" folder. not that its that big of a deal, but it adds to the clutter.

Re: quick cache garbage collection question

PostPosted: August 29th, 2011, 3:03 am
by jonown88
this issue is almost happen with every one and with me also i mail you the detail to for getting suggestion. :ugeek:

Re: quick cache garbage collection question

PostPosted: September 8th, 2011, 4:02 am
by Coopeh
davepoobond wrote:i am having a similar problem with the garbage collection.

the auto-expiration does not seem to happen at all. The only time it'll clear out all the files that are in the cache are when i click the "clear cache" button in the top right.

When i try to see the permissions for cache folder, it doesn't allow me to change the permissions and is "owned by nobody." It is locked in a 755, and i can't delete them through ftp.

ive also tried changing "cache" to "cache1" only to see another "cache" folder created, i'll guess by the quick cache plugin, and unable to change the permissions on that one either.

it seems that quick cache likes to make folders that aren't owned by anybody...

as a result, i'm guessing that the auto-expiration isn't able to delete anything because it doesn't have proper permissions. But i don't understand why that would be different than me simply clicking the "clear cache" button.


any help? Also, now i'm stuck with a "cache" and a "cache1" folder. not that its that big of a deal, but it adds to the clutter.


Doing this I figured out my wp-config.php was owned by the wrong person and wasn't allow Quick Cache to write it's rules. Also set ownership and group ownership chown/chgrp the same for the cache directory. All seems to work properly now. This is on a large scale Multi Site blogfarm too.