[wp-trac] [WordPress Trac] #61193: Prime transient and transient timeout options in `get_transient`
WordPress Trac
noreply at wordpress.org
Fri May 10 22:40:18 UTC 2024
#61193: Prime transient and transient timeout options in `get_transient`
--------------------------------+-----------------------------
Reporter: peterwilsoncc | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Options, Meta APIs | Version:
Severity: normal | Keywords:
Focuses: performance |
--------------------------------+-----------------------------
On sites without a persistent cache, temporary transients are stored in
two options. One containing the transient itself, the other containing the
timeout. These are stored as `_transient_[transient name]` and
`_transient_timeout_[transient name]`.
Currently WordPress makes two database queries to get these options. With
the introduction of `wp_prime_option_caches()` in WordPress 6.4 it's now
possible to reduce the querying of expiring transients to a single
database request.
While a mild improvement on sites using a limited number of transients, I
think it could become reasonably significant on sites running plugins that
make heavy use of transients. WooCommerce being one example I can think
of.
Follow up to #58962.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61193>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list