如何让WordPress网站打开速度变快

  • 2010-09-24
  • 1,804
  • 0
  • 0

最近发现自己的网站打开速度越来越慢,以为是godaddy主机出了问题,赶紧写信咨询godaddy客服,态度很好,1小时之内就回信了。这是她给我的建议:

1GZIP网页压缩

Compression is a simple, effective way to save bandwidth and speed up your website in Linux Shared Hosting. By adding a piece of PHP code to the top of your Web pages, you can instruct the Web server to compress files for transit to your visitors’ Web browser. This is especially useful for text-heavy Web pages that are over 100K in size.(这段不翻译了,就是讲压缩的好处)

网页的最上方,就是header.php中,在DOCTYPE前面加入以下代码:

<?php if (substr_count($_SERVER[‘HTTP_ACCEPT_ENCODING’], ‘gzip’)) ob_start(“ob_gzhandler”); else ob_start(); ?>

Rename the file you want to compress with a .php extension instead of .html or .htm and upload the file to your site. The file will be compressed upon request and delivered to the visitors’ browser.(这段不知道是什么意思)

2、图片大小

直接将图片变小再上传,而不是编辑日志的时候缩放

3.脚本

能用代码实现的尽量用代码实现

4.CSS

主题中没用的东西删掉,少用插件而改代码,这个貌似难度很大,媛诺诺不懂代码。

评论

还没有任何评论,你来说两句吧

发表评论