Implementing the service is very simple and comes down to reconfiguring
本帖最後由 niyadiw130 於 2024-1-24 18:06 編輯The DNS records of our domain - for a detailed description of how to do it, please refer to the CloudFlare help documentation. The most important thing - for our applications, the free version of the service is completely sufficient3. We are boosting our website. All CloudFlare clients using HTTP2 have Server Push enabled by default, but as I mentioned earlier, this is not enough. We still need to do some digging in our htaccess file to enjoy the benefits of this technology.
The trick is to add a directive to add an additional http header: Header add Link '</sciezka/do/styl.css>; rel=preload; as=stylesheet' Where: preload – information (for the server and client) that a given Phone Number List resource will be sent via push as – resource type, possible values are presented in the table below http2article-table Resource paths must be relative and "local" they cannot be pointers to objects outside our domain. We do not change anything in the code of our website, we do not remove references to objects that we have declared as a link in htaccess! And that's pretty much it.
http://zh-cn.ealeads.com/wp-content/uploads/2024/01/%E9%98%BF%E5%B0%94%E5%B7%B4%E5%B0%BC%E4%BA%9A-%E7%94%B5%E8%AF%9D%E6%95%B0%E6%8D%AE-30-300x106.png
What should you remember? The added link headers should indicate "universal" resources that are loaded on all pages of our website,global styles, scripts, logo images, menu icons, fonts, etc. There is no point in pointing to an image that appears only on one specific page of our website. If we want to optimize the speed of a specific page, I suggest using the following syntax <Files /sciezka/do/konkretna-strona.php> Header add Link '</sciezka/do/obrazek1.jpg>; rel=preload; as=image' Header add Link </Files> If a group of pages that can be identified using a regular expression is to be optimized, I suggest using FilesMatch.
頁:
[1]