Quick Cache (Speed Without Compromise)
Cache directory is enormous (12 posts)

  1. dicknet
    Posted 3 years ago #

    Hi. Love this plugin - I'm using it all over the place.

    However, on one particular site, the cache directory is enormous - about 48MB. I'm seeing a lot of files there from August, September, and October. This is November and I have the cache expiration set to 3600. So why are there still files in the cache directory from 3 months ago?

    Thanks for your help.


  2. dicknet
    Posted 3 years ago #

    On further research I found that the old files are cleaned up when I clear the cache manually. So my question is: What would cause the plugin to fail to run its own cleanup?

  3. Kimberly
    Posted 3 years ago #

    sounds like its specialized cron it adds to wp-cron list isn't working on your end. When i check my list i see a quick cache garbage clean up that is run either one per hour or once per day (cant remember which).

    Curious...are those old pages continuing to use those old cachce files even though when you check the bottom of the page the expiration date indeed shows it has expired?

  4. dicknet
    Posted 3 years ago #

    It does sound like wp-cron. What would cause that to fail and how do I diagnose its health?

    As for the old cache files, they're gone now. Hitting the clear cache button gets rid of them. But I don't want to have to do this manually.

    On further research, I've noticed this problem on several other sites. This first one came to my attention because of the enormous size.

  5. dicknet
    Posted 3 years ago #

    Oh forgot to mention that I still get notifications of new WP and plugin versions. So wp-cron is working, at lease some of the time.

  6. Kimberly
    Posted 3 years ago #

    Fascinating. I wonder if your problem is like the other fellow. Curious:

    1. Are ALL files not re-caching (remaining old)? Or just a selection of them?

    2. If only select files then is there a pattern such as query strings in their url?

    I would like to verify that loopback requests are working on your server.

    Try adding these 2 test files to your server and running the LoopbackTest-Call.php file from your browser:

    Note: Replace {YOUR SITE HOST NAME HERE} shown in the code below with your actual host domain (e.g:www .mysite.com).

    	$ch = curl_init();
    	curl_setopt($ch, CURLOPT_URL, 'http://{YOUR SITE HOST NAME HERE}/LoopbackTest-Reply.php');
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    	$html = curl_exec($ch);
    	echo "Loopback Response: ".$html;


    	echo "SUCCESS!!";

    If successful you should see "Loopback Response: SUCCESS!!". It's important that you call the LoopbackTest-Call.php file from your browser and NOT the LoopbackTest-Reply.php file. Once we know loopback requests are working on your server then we can continue to pinpoint what is going on.

  7. dicknet
    Posted 3 years ago #

    To answer the last question first, here is the result of the loopback test: Loopback Response: SUCCESS!! Loopback Requests Work!

    So apparently it's not that.

    This issue came up in the context of moving sites from an old hosting provider to a new one. The time to do that is a function of size, and I noticed the sites using caching were disproportionately large. Right now only about half the sites are moved. But I have checked sites on both the old and the new server; both are exhibiting this problem. So we may be able to rule out some oddball setting on the server.

    I'm not seeing a pattern in what's in the old cache pages. I saw pages and posts, and something that looked like search results. One thing that seemed odd is that the URL I saw in the cache file is the WP 'default' form, not the permalink. I suspect that's intentional, though.

    One thing I did do today was to disable wp-cron and, instead, run it from a cron job every 10 minutes. Too soon to say if that made any difference.

    HTH and makes sense.

  8. dicknet
    Posted 3 years ago #

    FWIW, here is the cron record from the wp_options table in the database. As you can see there is an entry for garbage collection. Whether or not it's formatted correctly, I have no idea:


  9. Kimberly
    Posted 3 years ago #

    All looks good there.

    Curious, you mentioned that the "default" url form was in the cache file and not the permalink. To be clear you are saying you see something like: "http://www.mysite.com/?p=999" instead of "http://www.mysite.com/my-post"?

    Are you noticing it at the bottom of the cache file where it says This Quick Cache file was built for or are you seeing this default form at the very top of the cache file? If its at the top then that is normal; at the bottom would be odd (assuming permalink customizations are being used).

  10. dicknet
    Posted 3 years ago #

    Yes, the '?p=999' flavor. But you're right, it's at the top. The URL at the bottom is the permalink.

    Toying with the idea of a cron job to do a brute force clearing of the cache every night. Would prefer a proper fix, but the cron job would at least keep the storage under control.

  11. RonStrilaeff
    Posted 3 years ago #

    @dicknet ... did you every find out why it seems to be ignoring your 3600 sec "cache expiration time" ?

    I just did an experiment to clear my 19K (1.6GB or 3+ month's worth) of old cached files:
    A. Yesterday the "clear cache" button on the top admin bar never completed.
    B: Using filezilla to delete the contents caused filezilla to hang (or I just gave up)
    C: Just now, I changed the cache expiration time to 3601 and within seconds all stale cached files automagically disappeared. Yay!

    Fortunately my failed attempts never broke anything but I had to do something, since all file management tasks (like backup) were starting to fail due to the sheer volume of obsolete files.

    @websharks or @primothemes (developer, if you are still supporting this) ... my intuition says that there should never be any cached files on my server disk older than the "cache expiration time". If I'm wrong, what is the logic here?

  12. dicknet
    Posted 3 years ago #

    No, unfortunately not. As a workaround, I put in a cron job to clean it out by brute force every night. Not a great solution, but it was the best I could come up with.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic