The Transients API: Caching Expensive Work Inside WordPress
Transients let you store the result of a slow API call or heavy query so WordPress does not repeat that work on every page load. Here is how to use them correctly, including how they behave once a persistent object cache is in the picture.