The Transients API provides a standardized way to store data temporarily (with an expiration time) in the database.

learn more… | top users | synonyms

38
votes
3answers
9k views

Are transients garbage collected?

This question got me thinking Transient RSS feeds in wp_options not removed automatically? Transients are supposed to expire and be deleted. However the only way I see this handled is when transient ...
10
votes
5answers
1k views

When should I be using the Transients API?

I've never used the Transients API before and was wondering if anyone has guidance on when to use it. The Codex article implies that as a theme developer I might want to set each new WP_Query() as a ...
8
votes
3answers
5k views

How does object caching work?

I'm looking for a definitive answer here. When object caching is enabled, where do options and transients end up living? By default, both are stored in the database. But I've heard some references ...
8
votes
3answers
557 views

Is there any danger in deleting all transients?

I have a big site for a client, and as it is a really customized wordpress installation with lots of extensions on functionality, I can't use the caching plugins. To improve the performance, I built ...
5
votes
2answers
1k views

Cache remote (HTTP) request with Transients API

I am trying to use get_transient() method in my Wordpress, I have read the document and seems like I am doing what has been described in the docs. I need to show weather in my website and I am using ...
5
votes
2answers
321 views

Are transients private or public?

Are WP transients specific to the user-session or can they be accessed from any session anywhere? Since they are written to the DB, I would imagine they are public and accessible everywhere, but is ...
5
votes
2answers
955 views

Using transients in conjunction with memcached

I was hoping someone could clear the air for me when it comes to using transients with memcached. When running a plugin like w3-total-cache, are there any actual performance advantages to using ...
4
votes
1answer
159 views

Storing posts social counters by using transient api

I would like to know if it's a good practice to use transient api to cache social counters for every post. Loading post pages get quite slow while processing and getting all social APIs.
4
votes
3answers
251 views

Fallback when Transient API fails

I'm trying to figure out how to best solve an issue I have with 3rd party API's (OG, Foursquare, Yelp, etc.). I use the transient API to call and store the various data in order to: Not exceed any ...
4
votes
2answers
410 views

Does set_transient() overwrite/update transient option with same key?

Basically that's the question - I wonder if set_transient() overwrites/updates a transient option with the same key?
4
votes
1answer
203 views

Fragment caching increasing database queries

While implementing fragment caching on a wordpress site by using the technique described here: http://css-tricks.com/wordpress-fragment-caching-revisited/ I found that it seems to actually increase ...
3
votes
2answers
607 views

Best practices for using the transients API

I've recently come across the Transients API in Wordpress in hopes of improving the performance of the plugin that I'm trying to write. Basically the plugin is storing product details from the amazon ...
3
votes
2answers
2k views

wp-cron.php - How are WP's Cron transients removed?

I have a Wordpress Network that I am tasked with disabling the WP Cron and replacing it with an Apache Cron. I have set up a PHP script that when called by an Apache Cron will loop through all sites ...
3
votes
3answers
896 views

get_transient(), PHP switch(), and comparison operators

Im using a WordPress transient, which expires after an hour, to store a value which is an integer. Im trying to use switch() and multiple case() statements to evaluate if the transient exists or not ...
3
votes
1answer
236 views

Should the caching of WordPress menus be specific to each page?

Introduction In optimizing large WordPress Websites for performance I always look at caching certain parts of the Website, mostly (of course) those that require a lot of Queries/calculation. For the ...
2
votes
4answers
492 views

Long option names fail silently?

This was really driving me crazy. I was debugging some code with code-generated transient names and they were failing like crazy for no apparent reason. After much much pain and experimentation I ...
2
votes
1answer
312 views

Storing an XML Response (Transient)?

Haven't worked much with XML so I'm hitting a bit of a wall: function getapi() { $api_response = wp_remote_get( "http://example.com/getXML" ); $data = wp_remote_retrieve_body( ...
2
votes
1answer
193 views

Integrating WP-TLC-Transients with Wordpress - Where to Begin?

Last week, I asked about creating transients that would update before expiry to prevent users from waiting for the long loading time. I was pointed to WP-TLC-Transients which sound like exactly what ...
2
votes
4answers
794 views

Get a list of existing transients

I have been using transients a lot in WordPress since I discovered them, however to ensure my sites update properly when a post is edited or created I added a function to delete transients on post ...
2
votes
2answers
532 views

How to delete cached transients from a widget instance properly?

So I have created this widget which pulls a number of posts. And the query is being cached via transients. But I need the transient to be deleted whenever a post is saved so the query can be ...
2
votes
1answer
53 views

How to use transients and variables

I am trying to implement transient fragments, I've been doing what is suggested here: http://css-tricks.com/wordpress-fragment-caching-revisited/ While it is working for headers, footers, landing ...
2
votes
1answer
409 views

Transient caching for wp query

I read about transient in the codex and some questions and answers here. So i'm developing a web app based on wp. It works now, but i want to optimize it. Users manage content regulary, so crud ...
2
votes
1answer
58 views

Is priming a Transient Cache possible?

I'm currently using Wordpress Transient Caching when querying images I've uploaded and tagged. Using Transient Caching has really sped up these queries once they are cached, but unfortunately, once ...
1
vote
3answers
449 views

Transients vs CRON +Custom Fields: Caching Data Per Post

Wanted some opinions on a solution I'm trying to come up with: I have a fan/enthusiast plugin I'm working on for fans of TV shows. One of the custom post types attached to the plugin is a release ...
1
vote
5answers
10k views

Will it break my site if I delete all transient records in wp_options table?

My site currently has an outrageous 500k+ transient records in the wp_options table. This causes the table to be crashed frequently and so be my site. I thought transient records will all expired ...
1
vote
2answers
80 views

Transient API and caching Plugins

Hello wordpress NINJAS.... I am crazy about transient api and I have implemented it in my theme.My question is If I use transient api is it required caching plugin? (I hate plugins!!!) If I use ...
1
vote
1answer
83 views

How to cache posts based on $_GET? Option name is too long? Options / transients

I have a search feature set up that is fairly expensive and I want to cache the results, based on the $_get string, like: ...
1
vote
1answer
1k views

WP_Query Performance Issues with meta_query

I'm working on a custom template for a new theme that uses a WP_Query instance to select posts from 2 post types with 2 custom fields that are NOT empty. Depending on the section of the site, a ...
1
vote
2answers
408 views

WordPress Caching - Transients API or “update_user_meta ” Cronjob?

I'm trying to set user meta based on queries. Basically, things like IF the query returns true, set this or if not, set this (or don't set it, if it is true). This works great but the problem is I ...
1
vote
1answer
89 views

How to delete transients written by fetch_feed()?

I'm using fetch_feed() to cache external rss sources displayed in a widget. in case the widget (or, more likely, the whole plugin) is deleted/deactivated, i want to manually delete all related ...
1
vote
1answer
88 views

Messing up with transient API - getting flushed on refresh

Following the _s theme I wanted to make my own version of Post Categories List with Transient, and here's what I made: function my_blog_categories() { global $post; if ( ( ...
1
vote
2answers
80 views

Looping through posts per category gives same posts for each category

For a specific section on my website I loop through some categories and get the three latest posts in that categorie and list them. Like so: <?php $categories = get_categories(array('exclude' ...
1
vote
1answer
80 views

Minimize database queries to user tables?

I'm trying to come up with a strategic way to collect large amounts of usermeta data (and output to the screen) while keeping database queries low. Some pages, like the home page, single pages, and ...
1
vote
1answer
78 views

Is this the proper usage of creating / using a transient?

I'm new to using transients. Is this the proper format to create a transient and have it pull from the DB instead of using the http api? I have standardized my snippet so others can double check ...
1
vote
1answer
136 views

Get the timout value of a saved transient?

Does anyone know if there is a Wordpress function to get the timeout value of a saved transient? I am using a transient with a 5 minute timeout to cache data from a web API call locally. Between ...
1
vote
1answer
347 views

How can I store an image in the database with Transients API?

I'm trying to store an image generated with imagecreatefrompng() using the Transients API, but it just stores an empty string (string(0) ""). Also, I notice if I set the transient before imagedestroy( ...
1
vote
1answer
55 views

Should I use the Transients API to temporarily hold edited attachements?

I'm building a store that allows users to order prints of photos. If the user orders a photo that has a different dimension than the one the photo is originally, they are prompted to crop the photo. ...
1
vote
1answer
401 views

Transients API and multisite

we're using the Atlas HTML sitemap plugin, which caches the sitemap using the transients API with a call like: set_transient( 'dmac_html_sitemap', $output, 60*60*24*7 ); Now, we also have a ...
1
vote
2answers
273 views

Transient not working for custom loops

I'm working at a WordPress theme. Since I need to display featured posts, related posts, some widgets with recent posts and so on, I need to use multiple custom loops. Because of this, the number of ...
1
vote
1answer
68 views

Transient unique names

What would be the correct way to assign a different name to each transient for each instance of a plugin used as a widget or shortcode?
1
vote
1answer
316 views

Using a wildcard with delete_transient()

I am using the Transients API to hold the output for a gallery plugin's shortcode I created. Due to the number of images used and different layouts needed, the transient name looks lik the following: ...
1
vote
1answer
468 views

Transient / object cache maximum key length [duplicate]

Possible Duplicate: Long option names fail silently? The WordPress Transients API makes it easy to save expensive values and look them up later. If you install an object backend (such as ...
1
vote
1answer
19 views

Hook an action when a transient is deleted ? Can't get it to work!

I'm working on a plugin, and it caches a remote page when requested. The file is created with tempnam(). I save the path of that cached file in a transient, using the transient API. Once the ...
1
vote
0answers
54 views

Transient storage location? database/xcache/w3Total Cache?

I've been working to speed up my site by utilizing transients to store rendered HTML and it works great. I've set up checks that clear specific transients upon post/page/data updates and it all works ...
1
vote
1answer
205 views

How to delete a transient on post/page publish?

I have a transient set for a custom query. It expires in 30 days. But I also need it to expire once a new post/page is published. So that the new published post/page is available in that custom query. ...
1
vote
0answers
34 views

wp_options flooded with transient API entires

I make heavy use of the WordPress Transient API. Suddenly a few days ago my wp_options table began being flooded with transient entries (2GB worth on average). Normally WordPress only writes them to ...
1
vote
0answers
107 views

Transients and WP Super Cache? [closed]

Is it worth using Transients when running WP Super Cache? We have a website that get's updated 20 times a day with new post, so I set a lot transients for queries that don't reflect those updates. My ...
1
vote
1answer
137 views

Transient pagination not working properly

So I wrote the following to create a transient: $wp_object_i_created = new WP_Query('cat=1'); set_transient('category_one_posts', $wp_object_i_created, 60*60*1); Ok so then I decided "Ya know lets ...
1
vote
1answer
43 views

Transients API conditional

I have the following transient, but if the user changes the value of $url the transient should not be used. I want to know what is the most appropriate way to use this variable with the transient. ...
1
vote
0answers
220 views

After having installed APC Object Cache Backend transients stopped working

My understanding is that once you enable the persistent object cache, your transients are no longer stored in wp_options but in the cache. Once I installed Mark Jaquith's APC Object Cache Backend, ...