• Resolved wpshushu

    (@wpshushu)


    Hi,

    Is there a way to programatically turn off object cache on the fly?

    Is there a flag to force loading a page withou using object cache?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author OllieJones

    (@olliejones)

    The WordPress persistent object cache subsystem doesn’t work that way. Stuff would break if it were disabled on certain pages or at certain times. For one thing, when the persistent object cache is enabled, WordPress puts transients in it rather than in the wp_options table.

    If you reply to this thread explaining why you want to do this, I might be able to offer better advice.

    Thread Starter wpshushu

    (@wpshushu)

    @olliejones After some investigation, the best option seems to use the wp_cache_add_non_persistent_groups call. With one exception though, how can I exclude the default group (just for debugging purposes) because many of the wp_cache_set calls don’t specify a particular group, they are stored in the default group(the unamed one), can I use

    wp_cache_add_non_persistent_groups([”]);

    Plugin Author OllieJones

    (@olliejones)

    https://github.com/OllieJones/sqlite-object-cache/blob/1e192c4872ed90e5f2d9e9aa0bde71319edfaaa9/assets/drop-in/object-cache.php#L1441C1-L1446C1

    Yes, that should work. I haven’t tested it. It has to be said, disabling the default group disables a lot of performance-enhancing stuff.

    I really really want to understand what’s going on in your situation. It’s possible the API or my code has some sort of shortcoming or defect, and it would be good to fix it if so. Thanks.

    Thread Starter wpshushu

    (@wpshushu)

    @olliejones Hi, thanks. I understand it’s a bit unusal for me to throw such questions. My situation is like this, I eanbled object cache, then I found two things broken:

    1. many cron events start to overdue and manually issue wp cron event run –all didn’t fix that, only temporarily disabling object cache managed to bring the cron stats to normal – no overdue
    2. Elementor automatically regenrates css files under wp-content/uploads/elementor/css/, I found that if I keep object cache active, after a while, the css files could fail to regenrate which led to a broken site

    So I figure if I could exclude all cache groups including the default group then gradually remove them out of the non-persistent groups I could pin-pint the exact causes to the above issues.

    Plugin Author OllieJones

    (@olliejones)

    Thanks for this information. If you need more help please start another topic.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.