| 1 |
<?php |
| 2 |
/** |
| 3 |
* Header trait for shared compressor functionality. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Page_Cache\Compression\Traits; |
| 11 |
|
| 12 |
use SolidWP\Performance\Page_Cache\Compression\Contracts\Compressible; |
| 13 |
|
| 14 |
/** |
| 15 |
* Header trait for shared compressor functionality. |
| 16 |
* |
| 17 |
* @mixin Compressible |
| 18 |
*/ |
| 19 |
trait With_Headers { |
| 20 |
|
| 21 |
/** |
| 22 |
* Send Content-Encoding headers for the current compression strategy. |
| 23 |
* |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
public function send_headers(): void { |
| 27 |
header( sprintf( 'Content-Encoding: %s', $this->encoding() ) ); |
| 28 |
} |
| 29 |
} |
| 30 |
|