Title: programatically disable sqlite object cache
Last modified: June 28, 2024

---

# programatically disable sqlite object cache

 *  Resolved [wpshushu](https://wordpress.org/support/users/wpshushu/)
 * (@wpshushu)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/)
 * 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](https://wordpress.org/support/users/olliejones/)
 * (@olliejones)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/#post-17861133)
 * 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](https://wordpress.org/support/users/wpshushu/)
 * (@wpshushu)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/#post-17868902)
 * [@olliejones](https://wordpress.org/support/users/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](https://wordpress.org/support/users/olliejones/)
 * (@olliejones)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/#post-17869810)
 * [https://github.com/OllieJones/sqlite-object-cache/blob/1e192c4872ed90e5f2d9e9aa0bde71319edfaaa9/assets/drop-in/object-cache.php#L1441C1-L1446C1](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](https://wordpress.org/support/users/wpshushu/)
 * (@wpshushu)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/#post-17871236)
 * [@olliejones](https://wordpress.org/support/users/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](https://wordpress.org/support/users/olliejones/)
 * (@olliejones)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/#post-17965366)
 * Thanks for this information. If you need more help please start another topic.

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

The topic ‘programatically disable sqlite object cache’ is closed to new replies.

 * ![](https://ps.w.org/sqlite-object-cache/assets/icon-128x128.jpg?rev=2829632)
 * [SQLite Object Cache](https://wordpress.org/plugins/sqlite-object-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sqlite-object-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sqlite-object-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/sqlite-object-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sqlite-object-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sqlite-object-cache/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [OllieJones](https://wordpress.org/support/users/olliejones/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/programatically-disable-sqlite-object-cache/#post-17965366)
 * Status: resolved