Yeah.
The weird thing is that it is supposed to be cached, and I have no reason to believe that it is not.
$categories = get_transient( 'wpdc_discourse_categories' );
if ( ! empty( $options['publish-category-update'] ) || ! $categories ) {
$body = $this->discourse_request( '/site.json' );
if ( is_wp_error( $body ) ) {
return $body;
}
if ( $body->categories ) {
// removed for brevity
// Note that setting the cache to 0 will disable transient expiration.
$category_cache_period = apply_filters( 'wpdc_category_cache_minutes', 10 );
set_transient( 'wpdc_discourse_categories', $discourse_categories, intval( $category_cache_period ) * MINUTE_IN_SECONDS );
return $discourse_categories;
} else {
return new \WP_Error( 'key_not_found', 'The categories key was not found in the response from Discourse.' );
}
}
EDIT When I list the transients I do have a key timeout_wpdc_discourse_categories with a value of a timestamp in 5 minutes, but I do not have a wpdc_discourse_categories ![]()
EDIT 2 set_transient( 'wpdc_discourse_categories', $discourse_categories, intval( $category_cache_period ) * MINUTE_IN_SECONDS ); is returning false. $discourse_categories is correctly filled. Other transients are working.