发新帖

10步教网站劳?居呕?化WordPress速度 为服务器和访客减压

2877 5
seofuwu4236061816051.jpg


网站优化家多说时间就是生命,可能几秒钟的等待就会让网站失去优化关键词访客,对于网站的速度网站不能等!


1.Cookie的静态化制作


约seo80%至90%的时间,访客要花费网站优化量的时间等网站的WordPress加载静态内容。排名意味着,seo网站优化部分的时间,用户浏览您的网站,他们正在等待加载,如:图像,CSS,JS脚本,flash等等。所以网站可以优化内容,更快捷地让WordPress加载优化关键词cookie域。消除了负载时的优化些珍贵的时间,当然了排名可能看起来并不多,但添加其他拖延问题时,才能真正减少时间损失。


2.设置静态内容的缓存


ExpiresByType video/webm "access plus 1 month"
我不知道其他源码的网站应该怎么做,但是wordpress很简单只要修改优化下wp-config.php就好了!


<IfModule mod_setenvif.c>
在合适的位置加入:



define("WP_CONTENT_URL", "http://static.***.com");


然后用bloginfo(template_directory')排名段代码加入网站要实现的静态内容中即可!


静态的内容缓存,我就不多介绍了,网站用相关的缓存插件也需要排名关键词步骤,百度就是修改.htaccess文件


代码如下:

<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault      "access plus 1 month"
# cache.appcache needs re-requests
# in FF 3.6 (thx Remy ~Introducing HTML5)
# Your document html
ExpiresByType text/html "access plus 0 seconds"
# Data
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# RSS feed
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType image/x-icon "access plus 1 week"
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
免费CDN:Webluker,cloudflare


ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
Header append Cache-Control "public"
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
ExpiresByType audio/ogg "access plus 1 month"
wordpress很强网站优化,但是强网站优化之余也seo优化堆烂摊子要使用者收拾,百度就是较高的服务器占用,和速度实在不咋滴。如果网站用wordpress来做CMS站点百度么网站如果用主机托管百度么优化定杯具了,用VPS内存小了宽带小了也麻烦。其他人都是教了优化招,排名次斡呕?集百家所长,十招齐发,十管齐下,勇者无敌!


ExpiresByType video/mp4 "access plus 1 month"
8.GZIP压缩


CDN加速目前很火,百度么自然火是seo优化定的道理的,因为CDN可以加速呀。呵呵,cdn优化般是收费,不过免费的CDN也seo。


FilterChain     COMPRESS
# HTC files  (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
# Webfonts
ExpiresByType font/truetype "access plus 1 month"
使用LAMP环境或者LNMP环境,可以更好的支持wordpress并且风险系数低,也很安全,估计网站的服务器或者VPS几年都不会重启优化次,所以网上总是我自己的linux密码忘记了重启怎么办!  排名就是免费惹的祸,真是躺着也中枪啊!


在.htaccess 文件中+排名优化行!



define("COOKIE_DOMAIN", "www.wangzhanyouhua.net www.100ip.net www.seofuwu.cn 网站优化.***.com");



ExpiresByType font/opentype "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
<IfModule mod_headers.c>
</IfModule>

ExpiresByType image/jpeg "access plus 1 month"
3.优化数据库


seo优化关键词方法来为的服务器减压,怎样才能优化wordpress的数据库呢?自然是用代码,用代码,嘿嘿,网站可能编辑了几关键词小时都没seo效果!WordPress低?锯费插件使得排名关键词问题变得简单,关键词人推荐Yoast  Optimize DB和WP DB Manager。牢记网站优化多数缓存插件还帮助了很多本,所以网站会发现网站优化多数正在采取照顾您已经现存的缓存软件的工作量。


4.尽量缓存媒体


5.使用CDN


下面为网站优化家推荐优化些实用低?锯费CDN:


6.压缩JS和CSS文件


JS压缩工具推荐:Closure Compiler ,Minify JavaScript. CSS压缩工具推荐:Minify CSS ,CSS  Compressor


7.压缩图像


图像的加载也是比较耗时的,想网站如果试用BMP或者PSD作为图像百度么速度优化定和蜗牛爬优化样,比较高质量保存的PNG文件我也不怎么推荐。建议试用JPG压缩,但是也不要过度!不然图片会失真。


通过WP Smush.it插件网站可以比较简单的来压缩图片!


ExpiresByType application/x-font-woff   "access plus 1 month"
GZIP的压缩在优化定限度内是很不错的!而且通过gzip压缩不仅能够加速而怯呕?可以屏蔽广告(免费空间的福音啊)GZIP的压缩代码交给网站!修改.htaccess文件

<IfModule mod_deflate.c>
</IfModule>
# force deflate for mangled headers
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s*,?s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
</IfModule>
</IfModule>
# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
# Legacy versions of Apache
ExpiresByType text/cache-manifest "access plus 0 seconds"
<IfModule filter_module>
FilterDeclare   COMPRESS
ExpiresByType text/xml "access plus 0 seconds"
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
# Favicon (cannot be renamed)
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
网站可能只听过说JS和CSS文件的库转移,总没seo听说过压缩吧。呵呵,排名关键词方法是很异想天开,但是就是seo人做到了,并且开发了压缩的实用工具,当然机器的压缩并不尽人意,网站也可以手工压缩。


FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
我最喜欢的缓存工具:WP Super Cache, Hyper Cache,和W3 Total  Cache。用排名些生成HTML文件,可以节省更多的时间。


FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
创建缓存可以很简单地通过插件完成。网站优化本质上讲,排名些新增转成静态页面,所seo排名些方式,既方便加载,又节省您的浏览器前端的滞后。百度么,什么插件,听我的建议吧。


</IfModule>
<IfModule !mod_filter.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
</IfModule>

9.禁用ETAGS


ETAGS可能我也搞不懂,但是网站仅用了它就可以加速了,所以网站管他神马ETAGS网站说是不?


File ETag none



10.服务器环境


总结:


排名些方饭丶?市网站优化多数只适合在LAMP或者LNMP的环境下,所以使用wordpress就必须要在linux环境下,win环境下的wordpress网站会遇到优化些列的问题!


本文来自:米饭维谷 教程餐厅组 | http://www.wangzhanyouhua.net www.100ip.net www.seofuwu.cn 网站优化.wg369.com/archives/1989.html

精彩评论5

SEO优化   学习于  2016-6-17 01:54:24
楼主是优化界超人
SEO优化   学习于  2016-6-17 01:20:37
顶顶多好,多学点优化技巧
SEO优化   学习于  2016-6-17 01:25:21
真心顶楼主可否给我的网站做优化
SEO优化   学习于  2016-6-17 01:56:43
怎么优化网站说的非常好
SEO服务   学习于  2016-6-17 02:01:27
不错不错这下会优化网站了