WP script versioning breaks cross-site caching?

Use null as $ver param: wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js’, false, null); wp_enqueue_script(‘jquery’); Output: <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”></script>

Any reason why wp_cache_set not to work?

The wp_cache_*() functions are non-persistent caches which means that they only last during the current page request. This would be beneficial if you’re requesting the same information multiple times during page load. For example, if you’re showing recent posts in the header, content section, and sidebar ( calling the same code 3 times to retrieve … Read more

Extending WP_User class and using this sub-class during the whole lifecycle

If I did understand well, we need to cache a value retrieved from another REST service, from the login to logout of the user on the wordpress installation, so we will hook into this wp_login to get the value and cache it using Transient API, Options API or a persistent caching plugin. add_action(‘wp_login’, ‘my_get_and_cache_rest_value’); function … Read more

How can I reduce the number of database query calls for this custom homepage?

You could just write your own query, too. That way, it’s one query per category: global $wpdb; $query = ‘ SELECT wpp1.* FROM ‘ . $wpdb->posts . ‘ AS wpp1 LEFT JOIN ‘ . $wpdb->term_relationships . ‘ AS wptr1 ON wptr1.object_id = wpp1.ID WHERE post_type = %s AND post_status = %s AND wptr1.term_taxonomy_id = %d … Read more

How to use cache with simplepie

The example your using from the codex adds and removes it (probably not something you want to do), and is not very clear. By default WordPress will cache the feed for 12 hours using wp_feed_cache_transient_lifetime, the actual code WP uses for 12 hours is $lifetime = 43200 If you want to alter the cache time … Read more