---
title: "Transient"
description: "A transient is a piece of temporary, cached data stored with an expiry time. See how transients speed up sites by avoiding repeated expensive operations."
url: "https://nodea.io/en/glossary/transient"
lang: "en"
updated: "2026-07-13"
---

# Transient

> A transient is a piece of temporary data stored with an expiration time, used to cache the result of an expensive operation so it need not be repeated.

A **transient** is a piece of temporary data stored together with an expiration time, so that the result of a costly operation can be reused for a while instead of being recomputed on every request. The term is especially common in the [WordPress](https://nodea.io/en/glossary/wordpress) ecosystem, where the Transients API provides a simple way to cache data with a built-in lifetime.

## How transients work

A transient stores a value under a name, along with how long it should remain valid. When code needs that value, it first checks whether a non-expired transient exists. If it does, the stored value is returned immediately, skipping the expensive work. If the transient is missing or has expired, the code performs the operation, saves the fresh result as a new transient, and returns it. This is a straightforward form of [caching](https://nodea.io/en/glossary/cache-and-microcaching), where the expiry time plays a role similar to a [TTL](https://nodea.io/en/glossary/ttl) on other cached data.

## What transients are used for

Transients are ideal for data that is expensive to produce but does not need to be perfectly up to date every second — the result of a slow database query, a computed list, or a response fetched from an external [API](https://nodea.io/en/glossary/api). Caching such results as transients can dramatically reduce load and speed up pages, because most visitors are served the stored value rather than triggering the full operation. The key design decision is the expiry: too long and users see stale data, too short and the cache rarely helps. Depending on the platform, transients may be kept in the database or in a fast in-memory store, which affects performance. Used well, transients are a lightweight, effective tool for smoothing out the cost of repeated expensive work without introducing a heavy caching infrastructure.

### What happens when a transient expires?

Once its lifetime passes, the transient is treated as gone and the next request regenerates the underlying data and stores a fresh copy. This keeps cached values from becoming permanently stale.

## Related

- [Cache and microcaching](https://nodea.io/en/glossary/cache-and-microcaching)
- [WordPress](https://nodea.io/en/glossary/wordpress)
- [TTL](https://nodea.io/en/glossary/ttl)
- [API](https://nodea.io/en/glossary/api)

---

Languages: [pl](https://nodea.pl/pl/slownik-pojec/transient.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
