Allow persistent caching to be selectively skipped depending on cache backend

Created on 17 April 2011, about 14 years ago
Updated 26 June 2023, about 2 years ago

Attached patch fixes up some of the excessive caching we added during D7. In our zeal to avoid mysql load, we cache even fast queries because it is faster and more reliable to fetch from memcache, mongo, etc.

The patch creates cache_get_memory() and cache_set_memory() which no-op unless an in-memory cache backend is in use. Core won't set its DB backend to in-memory but memcache and others will. Setting this flag is all they have to do to gain these advantages.

You can see the node.module hunk of the patch that only a tiny change is needed at call time. This hunk refines the persistent caching added at #898360: Cache node types such that it only happens for memcache and similar backends. Upon positive feedback, I will add similar changes in other parts of core.

I think this is a good compromise. Open to other ideas.

Feature request
Status

Closed: outdated

Version

9.5

Component
Cache 

Last updated 12 days ago

Created by

🇺🇸United States moshe weitzman Boston, MA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    Wonder if this is still relevant for D10?

  • 🇬🇧United Kingdom catch

    I think this can be closed as outdated. The example in the issue summary is already in a dedicated bin (cache_entity) and you can define a null cache backend for that if you really want to. But more than that sites wanting to optimize their cache layer should use memcache instead of trying to tweak the database cache.

  • Status changed to Closed: outdated about 2 years ago
  • 🇺🇸United States smustgrave

    Thanks @catch!

Production build 0.71.5 2024