Xyzol

文章 分类 评论
21 6 22

站点介绍

这里是站点介绍...

开启GZIP压缩提升网站打开速度

xyzol 2022-01-10 794 0条评论 默认 Typecho 查询收录失败

首页 / 正文
站点公告

发布于2022-01-09

介绍

TypechoWordPress要提升网站的打开速度,除了服务器本身的网络线路外,CDN加速也是不错的选择;
而这里要说的是开启GZIP压缩以达到提升网站打开速度,GZIP压缩也是提升速度必不可缺的一环;

说明

以下方式同时适用于TypechoWordPress网站;

开启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

评论(0)

最新评论

  • Dririup

    viagra manufacturer Anyone that it take bromocriptine

  • Dririup

    Other drugs such as clonidine, clonazepam and, more recently, risperidone are widely used but efficacy is still open to question opinion levitra

  • Roubbogma

    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

  • Roubbogma

    cialis online prescription ASCO is supported by its affiliate organization, the Conquer Cancer Foundation

  • Roubbogma

    male viagra pill walgreens The organic layer was separated, washed with brine, dried MgSO 4, filtered, and concentrated under reduced pressure

日历

2023年06月

    123
45678910
11121314151617
18192021222324
252627282930 

文章目录

推荐关键字: docker项目 Typecho 一键 反向代理 bot sap

站点公告
站点公告
点击小铃铛关闭
配色方案