Does a query executed through wpdb class get cached?

Nope, doesn’t work like that. The database-related caching is minimal and mostly covers using precisely same queries during single page load.

Best way to cache persistently database and/or computationally intensive results is using Transients API to store results for fitting period of time.

Leave a Comment