发布于2022-01-09
介绍
Typecho
及WordPress
要提升网站的打开速度,除了服务器本身的网络线路外,CDN
加速也是不错的选择;
而这里要说的是开启GZIP压缩以达到提升网站打开速度,GZIP压缩也是提升速度必不可缺的一环;
说明
以下方式同时适用于Typecho
及WordPress
网站;
开启GZIP
其实开启GZIP的方法非常简单,只需在网站根目录下的index.php
文件中添加以下一条代码即可;
添加位置在<?php
之后即可;
注意:修改文件是网站根目下的index.php
文件,而非主题目录下的index.php
文件
开启GZIP压缩代码
/** gzip压缩Typecho&WordPress by sunpma */
ob_start('ob_gzhandler');
修改后的代码
<?php
/**
* Typecho Blog Platform
*
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
* @license GNU General Public License 2.0
* @version $Id: index.php 1153 2009-07-02 10:53:22Z magike.net $
*/
/** gzip压缩Typecho&WordPress by sunpma */
ob_start('ob_gzhandler');
结果测试
修改后可以用站长之家提供的网页GZIP压缩检测进行测试;
可以看到压缩率76.78%
网站的打开加载速度提升不少,可以说相当不错了;
原文地址: SunPma
viagra manufacturer Anyone that it take bromocriptine
Other drugs such as clonidine, clonazepam and, more recently, risperidone are widely used but efficacy is still open to question opinion levitra
cheap cialis online A recent meta analysis of 5 randomized and controlled trials that pooled data from 1256 patients provided additional evidence of the prognostic impact of TILs in the neoadjuvant setting 111
cialis online prescription ASCO is supported by its affiliate organization, the Conquer Cancer Foundation
male viagra pill walgreens The organic layer was separated, washed with brine, dried MgSO 4, filtered, and concentrated under reduced pressure