[wp-hackers] gzinflate Warning on transient expiration

Drew xoodrew at gmail.com
Fri Nov 30 21:22:18 UTC 2012


Hey guys,

I'm running into a frustrating issue where I'm getting a gzinflate Warning
on the first page load after transient(s) holding remote GETs have expired.

This is the error:

WARNING: wp-includes/class-http.php:1654 - gzinflate()
[function.gzinflate]: data error

I'm working with a method that pulls data via wp_remote_get() from various
sites based on the value of a post meta key. When the transient(s) have
expired I can see the transient has been set again, but it throws the
warning on the first page load. Refreshing the page clears the warning and
displays the value(s) of the transients. This happens every time the
transients expire.

So two questions:
1) Should I not be caching inside the method and if not, what are my
alternatives?
2) If the caching doesn't seem to be to blame, how do I overcome the
warning when transients are reset?

This is the block I'm concerned with:
$cached = get_transient( $meta->_stats_type . '-count' );
if ( false == $cached ) {
    $count = number_format( stats_count( $meta->_stats_type ), 0, '', ',' );
    set_transient( $meta->_stats_type . '-count', $count, 3600 );
}
return $cached;

Also, if it makes a difference, I'm working on localhost.

Drew
--


More information about the wp-hackers mailing list