[wp-trac] [WordPress Trac] #43112: set_transient uses object-cache as storage instead of cache layer
WordPress Trac
noreply at wordpress.org
Thu Jan 18 03:30:50 UTC 2018
#43112: set_transient uses object-cache as storage instead of cache layer
-------------------------+----------------------
Reporter: batooo | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Cache API | Version: 4.9.1
Severity: normal | Resolution: invalid
Keywords: | Focuses:
-------------------------+----------------------
Changes (by dd32):
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
Hi @batooo and welcome to Trac.
The transient functions are specifically cache functions, and are not
designed to be used for storage.
WordPress has three main "option" type stores:
- Options. Persistent data stored in the Database and cached in memory
- Object Cache. Non-persistent data not stored in the database and only
in memory if enabled.
- Transients. Non-persistent data backed by either the Object cache (if
enabled) or the Database otherwise.
Each storage option offers different levels of persistence, depending on
the actual need of the code. It's expected that Transients will remain
available for 0 ~ `$timeout` seconds, and it's by design that they may be
purged from memory instantly.
If you choose to utilise PHP's APCu functionalities, you should expect the
transient & object cache data to be dumped upon restart. If you choose to
use Memcache or Redis as the object cache, the data will be there until
purged or those services are restarted/etc.
The time to retrieve such items from the normal key-value object caches is
generally faster than fetching from MySQL directly (or allowing MySQL to
handle other queries)
Since this is by design, I'm closing this as `invalid` but hopefully the
above will help you understand the uses of the various storage options.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43112#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list