Title: Selectively disabling database or object caching
Last modified: November 8, 2022

---

# Selectively disabling database or object caching

 *  Resolved [verysiberian](https://wordpress.org/support/users/verysiberian/)
 * (@verysiberian)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/)
 * Hello,
 * My site uses a snippet to automatically generate a unique ID for a user at various
   points in the workflow (related to passing an exam). This worked normally until
   today, when someone processed several of them in relatively short period of time.
   About 15 users ended up with identical IDs when they’re supposed to be unique.
   There is nothing in the code that explains this. Three days ago, I enabled database
   caching (memcached) and object caching (memcached) through your plugin. I am 
   not blaming the plugin for this behavior — after all, I enabled these options—
   but am wondering:
 * 1. Is database or object caching a plausible cause of this abnormal behavior?
 * 2. Is it possible to selectively disable database and/or object caching for certain
   operations like this one that did not go well, or must it be an all-or-nothing
   setting?
 * Thanks,
    Very Siberian

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

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16181540)
 * Hello [@verysiberian](https://wordpress.org/support/users/verysiberian/)
 * Thank you for reaching out and I am happy to assist you with this.
    If the issue
   was specifically related to OC or DB caching, it would be manifested immediately
   and not after 3 days. To test this, you should disable the options and see if
   the problem continues to persist. In DB cahcing and Object Caching options, You
   should make sure that the caching is not enabled for logged-in users also, and
   as for the second question, you can add the specific query stems that should 
   not be cached in Performance>Database Cache, or exclude the words, pages: Ignored
   query stems: Reject query words: Reject constants: Never cache the following 
   pages: As for the Object Cache, if you know the cache group name, you can add
   it in the Performance>Object Cache>Non-persistent groups:
 * I hope this helps!
 * Thanks!
 *  Thread Starter [verysiberian](https://wordpress.org/support/users/verysiberian/)
 * (@verysiberian)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16181724)
 * Thank you! And I must not have been clear, but the issue did occur immediately,
   not three days later. You may have thought that this was related to my other 
   support ticket, but it was not. 🙂
 * I appreciate the suggestions and will try them.
 * Best regards,
    Very Siberian
 *  Thread Starter [verysiberian](https://wordpress.org/support/users/verysiberian/)
 * (@verysiberian)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16181773)
 * Sorry, one more question: there is no option to disable caching for logged in
   users under object caching. By contrast, such an option is visible for database
   caching. Please let me know if I’m missing something. Thanks!
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16181801)
 * Hey [@verysiberian](https://wordpress.org/support/users/verysiberian/)
 * Thank you for the clarification.
    I was referring to your statement in this form
   post:
 * > Three days ago, I enabled database caching (memcached) and object caching (
   > memcached) through your plugin.
 * > This worked normally until today,
 * Sorry if I misunderstood. 🙂
    As for the Object Cashing, make sure that the option
   Enable caching for wp-admin requests is not enabled.
 * Thanks!
 *  Thread Starter [verysiberian](https://wordpress.org/support/users/verysiberian/)
 * (@verysiberian)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16181807)
 * Thanks for clarifying!
 *  Thread Starter [verysiberian](https://wordpress.org/support/users/verysiberian/)
 * (@verysiberian)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16186107)
 * Hello again,
 * I really appreciate your plugin and your replies. If you can tolerate a couple
   more questions, I should be all set for a while. 🙂
 * 1. Object caching: I need to make sure that it does not occur for logged in users.
   You wrote:
 * > As for the Object Cashing, make sure that the option Enable caching for wp-
   > admin requests is not enabled.
 * I did that, but basically all of my logged in users are not seeing the WP admin
   backend. They are logged into the site and doing things on the frontend. Hence,
   my question is whether that setting you listed will be sufficient to prevent 
   object caching for any logged in users.
 * 2. What are your recommendations for database cache and object cache when the
   two visible choices are Shared Server: Disk and Multiple Servers: Memcached? 
   Which is the preferred option? For page caching, your plugin natively provides
   a recommendation (Shared Server: Disk Enhanced is Best), so I’m wondering about
   the other two.
 * Best regards,
    Very Siberian

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

The topic ‘Selectively disabling database or object caching’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [verysiberian](https://wordpress.org/support/users/verysiberian/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/selectively-disabling-database-or-object-caching/#post-16186107)
 * Status: resolved