当前位置:首页 > WordPress教程 > 正文

设置wp-config.php 给你的wordpress提速

wp-config.php一般都是配置数据库什么才用到的,其实wp-config.php也可以开启一些函数,当然,也可以对wordpress进行优化提速。

wordpress

01—博客地址和网站地址

设置地址而不是服务器检查,这将减少服务器查询。

define('WP_HOME', 'http://ihuan.me');
define('WP_SITEURL', 'http://ihuan.me');

02—允许缓存过期

启用wordpress自带的缓存功能,并设置缓存时间,是非常必要的事情

define(‘WP_CACHE’, true); // enable the cache
define(‘ENABLE_CACHE’, true); // enable the cache
define(‘CACHE_EXPIRATION_TIME’, 3600); // in seconds

时间为秒3600秒 为一个小时,当然这种缓存肯定不能与静态缓存相比啦

03 -禁用Post-Revisioning

Post-revision也许是最恼人的特性,不仅会导致臃肿的mysql数据库在几个月的时间里,它创造了大量的冗余的条目和占用了宝贵的数据库空间。

define('WP_POST_REVISIONS', false);

 04 -增加PHP内存

如果你使用的是虚拟主机,这个方法很不奏效。通常64M就绰绰有余了

define('WP_MEMORY_LIMIT', '64M');
define('WP_MEMORY_LIMIT', '96M');
define('WP_MEMORY_LIMIT', '128M');

文章翻译自geckoandfly 当然,也有自己的修改

标签:
上一篇: 下一篇:

13 条评论

评论加载中...
  1. 11楼
    这家伙可能用了美佬的代理 火狐浏览器 Windows 7
    Veronique  

    Fantastic blog you have here but I was wondering if you knew of
    any forums that cover the same topics talked about in this article?
    I’d really love to be a part of group where I can get advice from other knowledgeable individuals that share
    the same interest. If you have any suggestions, please
    let me know. Cheers!

    2018年7月25日 06:14 评论

发表评论

不理你。不要啊!吃饭。吃惊。吃西瓜。飞吻!恭喜!Hi纠结!膜拜!OK抛媚眼。泡泡糖。抛钱。忍!生闷气!调皮。偷看。委屈。献花。疑问?抓狂!

小提示:Ctrl+Enter快速提交助您一臂之力~
加载中……