WP_Http_Encoding::compress()public staticWP 2.8.0

Compress raw string using the deflate format.

Supports the RFC 1951 standard.

Method of the class: WP_Http_Encoding{}

No Hooks.


String|false. Compressed string on success, false on failure.


$result = WP_Http_Encoding::compress( $raw, $level, $supports );
$raw(string) (required)
String to compress.
Compression level, 9 is highest.
Default: 9
Optional, not used. When implemented it will choose the right compression based on what the server supports.
Default: null


Since 2.8.0 Introduced.

WP_Http_Encoding::compress() code WP 6.4.3

public static function compress( $raw, $level = 9, $supports = null ) {
	return gzdeflate( $raw, $level );