Transients API

Everything below is taken from WordPress Codex. You may ask me why I’m doing so?  -Just because it’s useful for my understanding of WordPress and may be it’ll be useful for somebody else who will find my blog in internet. As in Bible “Give, and it shall be given unto you”.

Overview

This page contains the technical documentation of WordPress Transients API, which offers a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted.

The Transients API is very similar to the Options API but with the added feature of an expiration time, which simplifies the process of using the _F9J_options database table to temporarily store cached information.

Note that the “site_” functions are essentially the same as their counterparts, but work network wide when using WordPress Multisite.

Also of note is that Transients are inherently sped up by caching plugins, where normal Options are not. A memcached plugin, for example, would make WordPress store transient values in fast memory instead of in the database. For this reason, transients should be used to store any data that is expected to expire, or which can expire at any time. Transients should also never be assumed to be in the database, since they may not be stored there at all.

The intended audience for this article includes WordPress theme authors, plugin authors and anyone who needs to cache specific data but wants it to be refreshed within a given timeframe. This document assumes a basic understanding of PHP scripting.

Set/Get Transient
Delete Transient

 

1 thought on “Transients API”

  1. Oh my goodness! an incredible article dude. Thanks Nevertheless I’m experiencing challenge with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting an identical rss problem? Anybody who is aware of kindly respond. Thnkx

Leave a Reply

Your email address will not be published. Required fields are marked *