• M

    (@infolegal)


    I’m experiencing a rather annoying issue. The cache are not being cleared from the server when I press the clear cache button and there’s 13GB of data already in the comet-cache directory even 3 months old, despite the settings in the plugin.

    Also, cached files are not deleted when the plugin is deactivated.

    I’m running the free version of the plugin.

    Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • @infolegal I suggest enabling PHP debugging (see https://codex.www.ads-software.com/Debugging_in_WordPress) to see if you’re getting any PHP errors when you try to clear the cache.

    It sounds to me like the Comet Cache might not have permission to delete the cache files or that your server is otherwise preventing Comet Cache from deleting those cache files.

    to free up space quickly, which directories are save to delete directly by ftp access?

    Thread Starter M

    (@infolegal)

    Hi Raam,

    I’ve set debug to true, but none of the warnings were related to Comet Cache. And rights on the server folders are as they should be. I had seen that in other forum topics and checked it already, before opening this ticket (to make sure I don’t duplicate).

    Thanks!
    M

    Thread Starter M

    (@infolegal)

    @mpek there’s a very good explanation here, for your questions: https://cometcache.com/kb-article/wipe-clear-purge-terminology/

    @mpek writes…

    to free up space quickly, which directories are save to delete directly by ftp access?

    You can safely delete the entire wp-content/cache/comet-cache/ directory if you disable and re-enable Comet Cache after doing so. Otherwise, if you don’t want to disable/enable Comet Cache, you can safely delete any directories (folders) inside wp-content/cache/comet-cache/cache/.

    @infolegal writes…

    I’ve set debug to true, but none of the warnings were related to Comet Cache. And rights on the server folders are as they should be.

    Hmm, that’s odd. You can see the routine that does the cache file deletion here. It uses the standard PHP unlink() and rmdir() functions and throws proper exceptions when there are problems (which would show up in the PHP error log).

    Have you checked with your web hosting company to see if they have any ideas? Also, can you tell me a bit more about the hosting environment? Web server version, server OS type, PHP version, filesystem type (e.g., NFS or Cloud-based storage?); all of those would be helpful. Some web hosting companies have particular server configurations that can cause problems with mass-deletions like Comet Cache does when cleaning up the cache, or they might have their own file system-level caching that can interfere with a WordPress caching plugin.

    @infolegal
    thanks for the article
    How did you find out how much space your cache consumes?

    @raamdev
    thanks for the quick tip.

    Does that mean that these files:

    .htaccess
    cc-advanced-cache

    should not be deleted?

    Thread Starter M

    (@infolegal)

    @raamdev:

    Also, can you tell me a bit more about the hosting environment? Web server version, server OS type, PHP version, filesystem type (e.g., NFS or Cloud-based storage?); all of those would be helpful.

    My site is hosted on a cloud server (shared environement) CloudLinux + KSplice, litespeed, PHP version 5.6.30 and MySQL 5.5.54-cll.

    The only thing I asked my webhost provider was which directory was the one eating up the space.

    I’ve been watching the space consumption and the Comet Cache directory gets at least 1GB bigger each day. I did notice the following:
    – after the data deletion, there’s a directory from feb 8 called cache-589d4fa862ffd375866253-tmp which didn’t get deleted anymore. Only the most recent directories get some content deleted. I assume I can safely delete the old tmp directory, right?
    – in each directory there are two folders, one for http and one for https. Why is that? My site runs on https only (a redirect is in place to handle older http indexed pages and load them on https)

    PS: my site is big – over 65k posts. And thanks for taking the time to answer. Must admit such a support level makes me wonder what would the benefits be if I rand the pro version instead of the lite one.

    @mpek

    How did you find out how much space your cache consumes?

    I wasn’t able to update a plugin due to quota beign exceeded so I started digging..

    As per your other question, it appears from the article I recommended and from @raamdev answer earlier, you can safely delete those files too as long as they are in the wp-content/cache/comet-cache/cache/ directory.

    Thread Starter M

    (@infolegal)

    @raamdev:
    I also found this interested topic (related to temp files being left behind) here: https://github.com/websharks/comet-cache/issues/397

    @mpek

    Does that mean that these files:

    .htaccess
    cc-advanced-cache

    should not be deleted?

    Yes, that’s correct. Those files should be left alone. If you do delete them, Comet Cache will automatically recreate them when you deactivate and reactivate Comet Cache (or if you click the “Restore Default Options” button inside the Comet Cache options).

    @infolegal writes…

    I assume I can safely delete the old tmp directory, right?

    Yes, any -tmp directories in the cache directory can safely be deleted, however keep in mind that Comet Cache creates those directories as part of its normal operations, e.g., when clearing cache files from a directory the directory is renamed to a -tmp directory and then the files are deleted from that directory. Once the files are deleted, the -tmp directory is also deleted. (It’s done this way so that if a visit to the site generates a cache file at the same time that Comet Cache is clearing cache files, the two operations don’t conflict with each other.)

    So, while it’s safe to delete -tmp directories as long as you’re sure they are old and have been around awhile, I wouldn’t recommend setting up a script or something that automatically deletes any -tmp directories from the cache directory, as that would interfere with the normal operation of Comet Cache.

    in each directory there are two folders, one for http and one for https. Why is that? My site runs on https only (a redirect is in place to handle older http indexed pages and load them on https)

    If your redirect is happening at the PHP (e.g., WordPress) level, then Comet Cache will see the http URL before it gets redirected and may create a cache file. So, all https enforcement should happen at the web server level, before the request ever hits PHP/WordPress. If you’re using Apache, you can do this by adding some rules to your .htaccess file. This ensures that even if an automated crawler (e.g., a search engine crawler) tries accessing URLs on your site without https, the web server redirects the request to https and then Comet Cache caches the page.

    Related to this, I should mention that we also have a new Apache Optimizations option coming in the next release of the Pro version that lets you “Enforce Exact Hostname”; see this GitHub issue for details: https://github.com/websharks/comet-cache/issues/101

    Regarding enforcing SSL: Here’s what I personally use in the .htaccess on my personal site:

    # BEGIN SSL Enforcer
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # END SSL Enforcer

    However, you’re running LiteSpeed and not Apache, so I’m not entirely sure if that will work for you. You might want to check with your hosting company.

    My site is hosted on a cloud server (shared environement) CloudLinux

    That is almost certainly the cause for the issues you’re having with Comet Cache being unable to delete files properly. Cloud-based hosting services often use distributed or network-based filesystems that don’t play well with file-locking or heavy writes/rewrites. I suggest working with your hosting company to see if you can resolve the issue or trying a different hosting platform. (See https://www.ads-software.com/hosting/.)

    Thread Starter M

    (@infolegal)

    @raamdev

    I’m handling the https redirection in htaccess already, with the exact rule you wrote in your answer.

    Cloud-based hosting services often use distributed or network-based filesystems that don’t play well with file-locking or heavy writes/rewrites. I suggest working with your hosting company to see if you can resolve the issue or trying a different hosting platform.

    Changing the hosting environement is not an option, I’m pretty happy with the service they provide. What exactely do I need to ask them to look at? Could you please be more specific?

    Many thanks.

    @infolegal It’s hard to say what you should ask specifically, given there are no error messages being generated.

    I’d start by explaining the issue, perhaps pointing them to this support thread for background, and explaining that Comet Cache uses cache locking via flock() (or, as a fallback, sem_get()). You could also explain that Comet Cache uses standard PHP rmdir() and unlink() functions to delete files in the cache directory and for some reason that’s not working for you.

    You might also let them know that Comet Cache has 100,000+ active installs in the wild and the issue you’re having is not widespread. We have thoroughly reviewed and optimized the code.

    There is unfortunately nothing else that Comet Cache can do here. If there are no error messages being thrown, then as far as Comet Cache can tell everything is in order, which means if files in the cache directory as not being deleted as expected, then something is amiss on the server.

    Thread Starter M

    (@infolegal)

    Thanks @raamdev. I’ll try discuss these things with my hosting provider.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Cache not cleaning up. 13GB of cached files’ is closed to new replies.