Hands up who has never heard ofWordPress Transients?
According to the codexhttp://codex.wordpress.org/Transients_API“…offers a simple and standardized way of storingcached data in the database temporarily by giving it acustom name and a timeframe after which it will expireand be deleted.”
You can think of transients as havingsimilar functionality to cookies.
There are single and multisitetransients.set_transient()get_transient()delte_transient()set_site_transient() *multisiteget_site_transient() *multisitedelte_site_transient() *multisite
<?php set_transient( $transient, $value, $expiration ); ?>$transient = (string) Name$value = (mixed) your value$expiration = (int) expiry in seconds(0 = never expire)Returns true if set, false if not set
<?php get_transient( $transient ); ?>$transient = (string) NameReturns (mixed) = the transient value or false ifit has expired and/or doesn’t exist.
Use transients whenever you are going to make multiple calls tobuild a list of information that you will have to output multipletimes.Use transients with external APIs and feeds.e.g. Grab your 10 latest tweets and store them in a transient.
Use the following method.value = get_transient(name) //get the valueIf (value) // if transient existsUse transient value e.g. output to screenElseGet the value from your sourceset_transient( name, value, expirytime)Do your stuff