JS压缩东西推荐:Closure Compiler ,Minify JavaScript. CSS压缩东西推荐:Minify CSS ,CSS Compressor
7.压缩图像
图像的加载也是比较耗时的,想你如果试用BMP或PSD作为图像那么速度一定和蜗牛爬一样,比较高质量保存的PNG文件我也不怎么推荐。建议试用JPG压缩,可是也不要过度!不然图片会失真。
通过WP Smush.it插件你可以比较简单的来压缩图片!
8.GZIP压缩
GZIP的压缩在一定限度内是很不错的!并且通过gzip压缩不但能够加快并且还可以屏蔽告白(免费空间的福音啊)GZIP的压缩代码交给你!修改.htaccess文件
<IfModule mod_deflate.c># force deflate for mangled headers# developer.yahoo/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/<IfModule mod_setenvif.c><IfModule mod_headers.c>SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s*,?s*)+|[X~-]{4,13}$ HAVE_Accept-EncodingRequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding</IfModule></IfModule># HTML, TXT, CSS, JavaScript, JSON, XML, HTC:<IfModule filter_module>FilterDeclare COMPRESSFilterProvider COMPRESS DEFLATE resp=Content-Type $text/htmlFilterProvider COMPRESS DEFLATE resp=Content-Type $text/cssFilterProvider COMPRESS DEFLATE resp=Content-Type $text/plainFilterProvider COMPRESS DEFLATE resp=Content-Type $text/xmlFilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-componentFilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascriptFilterProvider COMPRESS DEFLATE resp=Content-Type $application/jsonFilterProvider COMPRESS DEFLATE resp=Content-Type $application/xmlFilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xmlFilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xmlFilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xmlFilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobjectFilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xmlFilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttfFilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentypeFilterChain COMPRESSFilterProtocol COMPRESS DEFLATE change=yes;byteranges=no</IfModule><IfModule !mod_filter.c># Legacy versions of ApacheAddOutputFilterByType DEFLATE text/html text/plain text/css application/jsonAddOutputFilterByType DEFLATE application/javascriptAddOutputFilterByType DEFLATE text/xml application/xml text/x-componentAddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xmlAddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype</IfModule></IfModule>
9.禁用ETAGS
ETAGS可能我也弄不懂,可是你仅用了它便可以加快了,所以你管他神马ETAGS你说是不?
在.htaccess 文件中+这一行!
File ETag none
10.办事器情况
使用LAMP情况或LNMP情况,可以更好的支持wordpress并且风险系数低,也很平安,估计你的办事器或VPS几年都不会重启一次,所以网上总是我自己的linux密码忘记了重启怎么办! 这就是免费惹的祸,真是躺着也中枪啊!
总结:
这些体例中年夜大都只适合在LAMP或LNMP的情况下,所以使用wordpress就必须要在linux情况下,win情况下的wordpress你会遇到一些列的问题!
本文来自:米饭维谷 教程餐厅组 | .wg369/archives/1989.html