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?

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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