I want to set WordPress Transient via Variable Value.
WordPress has a cron named “delete_expired_transients
” as seen in the image below.
Working with transients with a timeout, I seem to be getting two transients created, and I don’t quite understand why. Looking at the source code on: https://developer.wordpress.org/reference/functions/set_transient/, it would appear this only occurs when wp_using_ext_object_cache() returns false.
This question got me thinking Transient RSS feeds in wp_options not removed automatically?
I’m looking for a definitive answer here. When object caching is enabled, where do options and transients end up living?
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’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 transient; I assume the same might be said for direct $wpdb queries and query_posts()
. Is that overkill? And/Or are there other places I should default to using it?
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.
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.
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: