• Resolved HKP

    (@hiskingdomprophecy)


    Hi Folks,

    I have my page cache lifespan set for 3 hours, and after 3 hours it is normally at about 3GB+ in size.

    However, as I post about 10 posts per day, during the day the cache rarely gets above 300Mb, due to the cache purging when I publish or save a post.

    Can you please let me have a couple of lines of code to insert into my child functions.php so that the full cache does not completely empty when new posts are published or edited?

    I think that may be make my cache more useful to site users during my working hours.

    As I am a user not and can’t write code, I have tried to get AI to provide solutions, but none have worked.

    Regards and thank you for your consideration,
    Angus

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    Thanks for contacting us about this! By default WP-Optimize isn’t supposed to perform a full cache purge when adding or editing posts, it’s supposed to purge the post being edited as well as the archive pages and the home page.

    However we do have a filter in the plugin that is possibly being set to True by another plugin or theme that can trigger a full cache purge when adding or editing posts.

    Can you try adding this line to your theme functions.php file?

    add_filter('wpo_purge_all_cache_on_update', '__return_false', 99, 1);
    Thread Starter HKP

    (@hiskingdomprophecy)

    @jbgupdraft

    Thank you for that code. I installed it in my child functions.php but it made no difference. The cache still empties on a post update.

    Would be pleased to try any other suggestions.

    Regards and thanks,
    Angus

    Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    Thanks so much for trying that. If that filter isn’t working it’s entirely possible that another plugin or the active theme are calling our wpo_cache_flush function to purge the cache when posts are added or updated.

    Could you send me a copy of your system report if you visit WP-Optimize > Settings > System Status and click on the Download Report button.

    You can feel free to redact any information from it but I’m hoping to set up my site with a similar theme and plugins so that I can check if one of those might be calling our cache clearing functions.

    You can use a site such as pastebin.com to paste the contents as the full report will be too long for a forum post.

    Thanks!

    Thread Starter HKP

    (@hiskingdomprophecy)

    Dear @jbgupdraft

    Thanks for your very clear reply. Your comments about the Theme helped me solve the issue. 

    I have a desktop XAMPP test version of the site with all the same plugins, so I was able to test the theme without disrupting the live site.  That showed that the theme was not the issue.   

    On the live site I tested the plugins and found the problem one.  It is a very old legacy plugin which I got Clause AI to update for me. On my third go-around with Claude it was still not working, when Clause suggested that an option in the minify plugin might cause the issue.  When that option was turned off, the Clause version worked. 

    However, it was also causing the WP-Optimize issue for me.  (Like a game of “whak-a-mole”, fix 1 and another pops up!) 

    So today I reinstalled the old and unsupported plugin and to my relief it worked 100% and so did your Cache functions, not clearing the cache on a post or update. 

    @jbgupdraft, I am so very sorry to have wasted your time on this. But till I got your last message, I had no idea how to error check the theme.   

    But when I downloaded the Report you asked for, I thought… “hmmm. I can’t ask @jbgupdraft to do all this checking!  Not reasonable.  Too much work!” And so with some thought and prayer I managed to solve the issue. 

    Thanks again for your thoughtful advice and kind offer of checking the setup.  That is really awesome and beyond my expectations in a support forum!  Awesome!! 

    Regards and thanks,
    Angus 

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.