Glossary entry

Transients API

The Transients API is the WordPress caching system for storing arbitrary data in the database or object cache with an optional expiration time — providing a simple, consistent interface for caching slow operations like remote HTTP requests, complex database queries, and computed values. The three core functions are: set_transient( $key, $value, $expiration ) to store data, get_transient( $key ) to retrieve it (which returns false if the transient has expired or doesn't exist), and delete_transient( $key ) to remove it. By default, transients are stored in the wp_options table with an expiration timestamp. When a persistent object cache (Redis or Memcached) is active, the Transients API automatically stores data there instead, making reads dramatically faster than a database query. Transients should be used for data that can be safely regenerated if the cache expires — they are a performance optimization, not a persistent data store.

No published articles use Transients API yet.

When new articles use this term, they will appear here.