PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.5.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.5.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Page_Cache / Compression / Strategies / Html.php

Html.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.5.0, at src/Performance/Page_Cache/Compression/Strategies/Html.php

82 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The fallback compressor, which doesn't actually compress.
4 *
5 * This just returns uncompressed HTML.
6 *
7 * @package SolidWP\Performance
8 */
9
10 declare( strict_types=1 );
11
12 namespace SolidWP\Performance\Page_Cache\Compression\Strategies;
13
14 use SolidWP\Performance\Page_Cache\Compression\Contracts\Compressible;
15
16 /**
17 * The fallback compressor, which doesn't actually compress.
18 *
19 * This just returns uncompressed HTML.
20 *
21 * @package SolidWP\Performance
22 */
23 final class Html implements Compressible {
24
25 public const EXT = 'html';
26
27 /**
28 * HTML is always supported.
29 *
30 * @return bool
31 */
32 public function supported(): bool {
33 return true;
34 }
35
36 /**
37 * HTML is always enabled.
38 *
39 * @return bool
40 */
41 public function enabled(): bool {
42 return true;
43 }
44
45 /**
46 * The file extension.
47 *
48 * @return string
49 */
50 public function extension(): string {
51 return self::EXT;
52 }
53
54 /**
55 * HTML has no specific content encoding.
56 *
57 * @return string
58 */
59 public function encoding(): string {
60 return '';
61 }
62
63 /**
64 * No additional headers required for HTML.
65 *
66 * @return void
67 */
68 public function send_headers(): void {
69 }
70
71 /**
72 * Pass through the content without any compression.
73 *
74 * @param string $content The content.
75 *
76 * @return string
77 */
78 public function compress( string $content ): string {
79 return $content;
80 }
81 }
82