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.

If I make an ajax call to a Wordpress transient, is the transient value taken from memory on the server or is a call to the database made?

I'm not using any caching plugins.

My application is fetching a tag list. The frontend will display matching tags as the user types. I'm assuming that all transients are loaded when the page loads. And therefore that the transient is fetched from memory when the ajax call is made. Yes?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Without object caching plugins transients are stored using options API and, if set to expire, they have auto-load disabled. Meaning:

  1. First request to transient needs to fetch it from database.
  2. Subsequent requests will get data from memory.

However note that "memory" here is memory space of single specific page load. It's not shared and not persistent.

Ajax request performs new network request to site, loads new instance of WP core and does the stuff. It's quite heave operation, which is hard to optimize and it's performance impact overall makes transient API overhead irrelevantly small.

share|improve this answer

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.