• Resolved iCanvas

    (@unison123)


    Hi guys, I’m having a nightmare with cache being deleted:

    1. The minute I log into the back-end (admin), the cache is gone. I have to reload the pages in a private window to get them cached again
    2. The cached pages will also randomly be ‘uncached’ without me logging in. I have no idea what is causing this?!

    I want the pages to stay cached forever until I decide to delete cache and regenerate the pages.

    I have Cache Timeout set to 0 to disable garbage collection. Plus preload mode is active and Refresh preloaded cache files is set to 0 minutes (0 to disable.

    Any idea what is causing this and is there ANY way or workaround to lock the cached files so they don’t get removed.?

    Help will be so much appreciated, thanks!

    .ps I have Ithemes security and Wordfence installed and see no errors in the WP Supercache screen.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Do you have Yoast SEO installed? If so, here’s a thread that will help.

    https://www.ads-software.com/support/topic/wp-super-cache-and-yoast-seo-incompatible/

    Thread Starter iCanvas

    (@unison123)

    Thanks SO much, Yes have it installed – will look into it!

    Plugin Support Tamirat B. (a11n)

    (@tamirat22)

    Hello @unison123

    Do you have updates about that? We usually close inactive threads after one week of no activity, but we want to make sure we’re all set before marking it as solved. Thanks!

    Thread Starter iCanvas

    (@unison123)

    Thanks – yes I think since trying the Yoast fix (by removing and adding another site identity image) it is better.

    It still looks like the cache is cleared when I log into the back-end. I couldn’t find a setting for that anywhere? If that’s part of the Yoast issue then feel free to close the ticket. Thanks again.

    The plugin shouldn’t clear the cache like that, so it might be another plugin or Yoast still doing it. If you figure it out, please reply here!

    Thread Starter iCanvas

    (@unison123)

    Thanks, yes it is tiring – every time I work on the site, I have to check if certain pages (that load slow and is the reason I use WP Supercache) is still cached.

    Isn’t there a way to set folder permissions to the cache folder to stop any other plugin or process to clear the cache? So when I want to clear, I can just temporarily se the permissions back to 755? Thanks!

    If you have root access to your server, then chown root:root <folder name> will change the owner of the folder to root so the plugin can’t delete any files, but it won’t be able to create new cache files either.

    You could also set the permissions with chmod 555 <folder name> so nobody has write access to the directory, but I tested it and was able to rmdir it.

    You could try protecting the single directories for the slow pages you’re worried about with chown if you’re able to use it.

    Thread Starter iCanvas

    (@unison123)

    Thanks so much – no unfortunately don’t have server access.

    Would chmod 555 on the specific page folders prevent them from being randomly removed?

    Thanks again!

    I don’t think chmod 555 will help. I tested it and I was still able to remove a directory.

    I just figured out there’s something else you can do. The plugin has a filter called “wpsc_protected_directories”. It received an array of directories that should not be deleted. You could modify that array with that filter. Something like this in an mu-plugin:

    <?php
    
    // don't let WP Super Cache delete these slow loading pages
    function do_not_delete_my_page( $pages ) {
        global $cache_path;
        $pages[] = $cache_path . 'supercache/example.com/slow_loading_page';
        return $pages;
    }
    add_filter( 'wpsc_protected_directories', 'do_not_delete_my_page' ); 
    

    Replace the path in ‘example.com/slow_loading_page’ with the path to your own page. If you modify the page, you’ll have to comment out that code and delete the cache by saving the page, or deleting it manually from the command line…

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @unison123,

    Do you need any help with this one? As mentioned earlier, we usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cache gets removed when logging in plus removed at random times?!’ is closed to new replies.