Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How does one go about locking down transient API requests for multiple threading? Has anything done some benchmarking, just how much can the transient API handle for multiple concurrent requests? It seems like it might cause some severe bottlenecks if not managed properly.

Also how would one go about forcing the transient API using WP's built in cron? For instance I have a transient firing on page load that I gather statistics from ( another seperate function) but if a page isn't visited then the transient is not updated, how would you loop through all the pages/posts using transient API to force an update?

The cron might also be effective in dealing with my first question to avoid multiple threading, too many requests and performance.

I have been wondering about this and recently a core dev alluded to it on a blog post, the Transient API is so simple to use but seems to lack some documentation for advanced management.

Any insights would be really appreciated.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

How does one go about locking down transient API requests for multiple threading? Has anything done some benchmarking, just how much can the transient API handle for multiple concurrent requests?

Under normal circumstances Transients API is essentially thin wrapper on top of Options API.

The difference is that (unlike plain options) transients might make use of object cache, if plugin that provides such functionality is installed.

So answer to this - transients perform as well as your database does, unless you change them to use another type of storage. Then it's as good as that storage.

Also how would one go about forcing the transient API using WP's built in cron? For instance I have a transient firing on page load that I gather statistics from ( another seperate function) but if a page isn't visited then the transient is not updated, how would you loop through all the pages/posts using transient API to force an update?

I am not sure what you mean here. Transients are merely storage mechanism. They are used to store and retrieve [expiring] data.

Anything other than that you will need to implement in your own code.

share|improve this answer
    
I was referring to what Mark J posted here, re-cycledair.com/caching-wordpress-data-with-the-transients-api. In terms of cron, I just want to know if using it with transients is possible or useful. –  Wyck Apr 3 '11 at 17:30
    
@Wyck I looked over that post and your comment there. Essentially transients have neither locking, garbage collecting or anything to do with cron. There is nothing that prevents you from using them in cron or in any other way you can imagine. Same about useful - as long as you find and implement what you need with them. –  Rarst Apr 3 '11 at 17:35
    
OK thanks, I figured as much I was just looking for some actual examples, time to dive in regardless. –  Wyck Apr 3 '11 at 19:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.