{"id":40,"date":"2024-05-12T17:16:52","date_gmt":"2024-05-12T09:16:52","guid":{"rendered":"https:\/\/a.li6.cc\/?p=40"},"modified":"2024-05-12T17:16:52","modified_gmt":"2024-05-12T09:16:52","slug":"php%e5%ae%89%e8%a3%85%e6%89%a9%e5%b1%95%ef%bc%9aphp-ext-brotli","status":"publish","type":"post","link":"https:\/\/a.li6.cc\/index.php\/2024\/05\/12\/php%e5%ae%89%e8%a3%85%e6%89%a9%e5%b1%95%ef%bc%9aphp-ext-brotli\/","title":{"rendered":"php\u5b89\u88c5\u6269\u5c55\uff1aphp-ext-brotli"},"content":{"rendered":"<p>\u4f7f\u7528\u573a\u666f\uff0c\u6211\u4eec\u5728curl\u91c7\u96c6\u7b2c\u4e09\u65b9\u7ad9\u70b9\u65f6\uff0c\u4f1a\u770b\u5230header\u8fd4\u56de\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre><code> content-encoding:br<\/code><\/pre>\n<p>\u4ec0\u4e48\u662fbr(Brotli)\u7b97\u6cd5<\/p>\n<p>Google \u8ba4\u4e3a\u4e92\u8054\u7f51\u7528\u6237\u7684\u65f6\u95f4\u662f\u5b9d\u8d35\u7684\uff0c\u4ed6\u4eec\u7684\u65f6\u95f4\u4e0d\u5e94\u8be5\u6d88\u8017\u5728\u6f2b\u957f\u7684\u7f51\u9875\u52a0\u8f7d\u4e2d\uff0c\u56e0\u6b64\u5728 2015 \u5e74 9 \u6708 Google \u63a8\u51fa\u4e86\u65e0\u635f\u538b\u7f29\u7b97\u6cd5 Brotli\u3002Brotli \u901a\u8fc7\u53d8\u79cd\u7684 LZ77 \u7b97\u6cd5\u3001Huffman \u7f16\u7801\u4ee5\u53ca\u4e8c\u9636\u6587\u672c\u5efa\u6a21\u7b49\u65b9\u5f0f\u8fdb\u884c\u6570\u636e\u538b\u7f29\uff0c\u4e0e\u5176\u4ed6\u538b\u7f29\u7b97\u6cd5\u76f8\u6bd4\uff0c\u5b83\u6709\u7740\u66f4\u9ad8\u7684\u538b\u5851\u538b\u7f29\u6548\u7387\u3002\u542f\u7528 Brotli \u538b\u7f29\u7b97\u6cd5\uff0c\u5bf9\u6bd4 Gzip \u538b\u7f29 CDN \u6d41\u91cf\u518d\u51cf\u5c11 20%\u3002<\/p>\n<p>\u6765\u81ea\u79d1\u666e\uff1a<br \/>\n<a href=\"https:\/\/www.cnblogs.com\/wcrBlog\/p\/11805506.html\">https:\/\/www.cnblogs.com\/wcrBlog\/p\/11805506.html<\/a><\/p>\n<p>\u8981\u89e3\u5bc6\uff0c\u9700\u8981\u7ed9\u5b9d\u5854\u73af\u5883\u5b89\u88c5php\u6269\u5c55<br \/>\n<a href=\"https:\/\/github.com\/kjdev\/php-ext-brotli\">https:\/\/github.com\/kjdev\/php-ext-brotli<\/a><br \/>\n\u5b89\u88c5\u597d\u540e\uff0cphp\u91cd\u542f\u4e00\u4e0b\u5c31\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u4ee3\u7801\u89e3\u5bc6curl\u83b7\u53d6\u5230\u7684\u5185\u5bb9\u4e86\u3002<\/p>\n<pre><code> $compressed = \\Brotli\\compress('test');\n echo $compressed;\n echo '<hr\/>';\n $uncompressed = \\Brotli\\uncompress($compressed);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u573a\u666f\uff0c\u6211\u4eec\u5728curl\u91c7\u96c6\u7b2c\u4e09\u65b9\u7ad9\u70b9\u65f6\uff0c\u4f1a\u770b\u5230header\u8fd4\u56de\u7684\u683c\u5f0f\u5982\u4e0b\uff1a c &hellip; <a href=\"https:\/\/a.li6.cc\/index.php\/2024\/05\/12\/php%e5%ae%89%e8%a3%85%e6%89%a9%e5%b1%95%ef%bc%9aphp-ext-brotli\/\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/posts\/40"}],"collection":[{"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":1,"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":41,"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/posts\/40\/revisions\/41"}],"wp:attachment":[{"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a.li6.cc\/index.php\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}