What’s the case against transient-ing almost everything that’s mostly static?

Actually, doing it for menu is good, you can even store entire HTML output and cut not only queries, but processing time too. Additionally, you can use WP_Object_Cache directly in conjunction with Redis/Memcached backend and avoid even single DB query for the transient itself. Re comments – they do change, so running WP_Comment_Query is unavoidable. … Read more

wp-cron.php – How are WP’s Cron transients removed?

Transients expire on their own. No need to unset them. And to call wp-cron manually is simple. Just define DISABLE_WP_CRON to true in the wp-config file to disable the normal cron spawning process. Then make your cron system hit wp-cron.php manually every so often to process pending jobs. There is no other special trick that … Read more

Get a list of existing transients

The db query would look like this: SELECT `option_name` AS `name`, `option_value` AS `value` FROM $wpdb->options WHERE `option_name` LIKE ‘%transient_%’ ORDER BY `option_name` To sort the results by their function (site transients, timeouts) use a function like this: add_action( ‘shutdown’, function(){ global $wpdb; $sql = “SELECT `option_name` AS `name`, `option_value` AS `value` FROM $wpdb->options WHERE … Read more

Using transients in conjunction with memcached

When and how to use transients or the object cache is a bit tricky and site-dependent. Here’s the breakdown: When not using a persistent object cache (like memcached): Transients are stored in the database Objects in the object cache are only cached for the duration of the page request. When using a persistent object cache … Read more

Why are transients cleared prematurely?

TL;DR WordPress part of transient handling is solid, everything is pretty precise Transients use object cache instead of data store for non-default implementations It means that some back-end cache systems get rid of cache that hasn’t been accessed recently Bottom line: it’s not WordPress fault, it only depends on how your back-end cache is set … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)