I'm new to using transients. Is this the proper format to create a transient and have it pull from the DB instead of using the http api?
I have standardized my snippet so others can double check their code as well...
function google_transient() {
$url = 'http://www.google.com';
$the_whole_body = wp_remote_retrieve_body( wp_remote_get($url) );
$transient_name = 'google';
// Get any existing copy of our transient data
if ( false === ( $transient_name = get_transient( $transient_name ) ) ) {
// It wasn't there, so regenerate the data and save the transient
set_transient( $transient_name, $url, 60*24); // 24 hour cache
}
return $the_whole_body;
}