How I increased by blog’s load speed by 50% using YSlow我如何增加博客的负荷速度由50 %的人使用yslow

Posted on August 10, 2007 at 12:57 pm发布于2007年8月10日在下午12时57分

Make sure to read other posts from the FireFox YSlow series!切记阅读其他职位从火狐yslow系列!

  1. Use YSlow Firefox add-on to analyze the performance of your web site使用yslow火狐附加元件性能分析你的网站
  2. How I increased by blog’s load speed by 50% using YSlow我如何增加博客的负荷速度由50 %的人使用yslow

YSlow yslow is a great site performance tuning tool that every blogger and site owner should use!是一个伟大的工地性能调优工具,每一个Blogger和网站所有者应当使用! Using YSlow, I was able to have my WordPress blog load almost twice as fast as before by changing a few simple things.用yslow ,但我能有我的WordPress博客负荷几乎快一倍,才通过改变几个简单的事情。 WordPress may not have the most optimized code in the world, but most blogs are running slow because of their own lack of understanding of what it takes to make a web site load quickly.在WordPress未必有最优化的代码,在世界上,但大多数博客正在运行缓慢是因为其本身缺乏了解,如何才能使一个网站负荷迅速。

The Simple Stuff 简单的东西

Interestingly enough, I was able to see a 25% improvement in load time by doing the following things:有意思的是,我能看到一个25 %的改善负荷时间做下列事情:

1. Removing SideBar Items - Removing blog directory links from my sidebar and cleaning it up so that it only contains a RSS subscribe, Pages, Categories, Archives, and two third-party links, one to Technorati and one for Spotplex. 1 。拆除侧栏项目 -删除博客目录连结到我的侧栏和清理了,所以,它只含有的R SS订阅页面,分类,存档,以及两位第三党联系,一到t echnorati和1 s potplex。 Earlier I had BlogTopList, BlogTopArea, and a few other blog ranking chicklets on my sidebar that were causing almost 10 DNS lookups each time the front page loaded.刚才我已经blogtoplist , blogtoparea ,和其他一些博客排名chicklets对我的Sidebar即造成了近10的DNS查找,每次头版装货。

I also removed all JavaScript trackers like MyBlogLog, except for Google Analytics.我还取消了所有的JavaScript追踪limit a search 。一样,除了Google Analytics功能。 There’s really no need to be tracking using 5 different tracking sites, it only causes more DNS lookups.还有的实在没有必要予以跟踪用5种不同的跟踪遗址,它不仅造成更多的DNS查找。 When you run YSlow, check #9 to see how many DNS lookups you currently have.当你运行yslow ,检查# 9看看有多少的DNS查找,您目前有。

2. Delete Useless Plugins - Deactivated useless plugins that were only adding more code to my page or not very helpful in terms of getting traffic or helping a reader while on a page. 2 ,删除无用的插件 -已停止使用的无用插件认为只有增加更多的代码到我的网页或帮助不大,在条件越来越交通或帮助读者的同时,就了一页。 For example, I was using FeedBurner’s FeedSmith code to add an Email This, Digg This, etc to my posts, but I already have ShareThis installed and a few other social bookmarking links at the top of my page.举例来说,我所用的feedburner的feedsmith代码放入一个电子邮件, digg本等,以我的职位,但我已经有sharethis安装和其他一些社会书签链接上的比赛我的网页。

Also, I had more than one tagging plugin installed, which was not helping in any way, so reduced it down to simply Technorati tags.另外,我曾不止一标注插件安装,因为这是不帮助任何方式,因此减少了它放下,以简单Technorati标记。 Another thing that I did which seemed to help was to actually DELETE the deactivated plugins from the wp-contents\plugin directory.另一件事,我也似乎帮助,以实际删除停用插件从可湿性粉剂-目录\插件目录。 I’m not sure why, but this helped a somewhat also!我不知道为什么,但这种帮助也有点!

More Interesting Stuff 更有趣的东西

The above-mentioned steps are easy and a very quick way to lower the load time for your web pages, but there are a couple of more things that I was able to do that helped even more!上面提到的步骤是很简单的一个非常快速的方法来降低负载的时候你的网页,但也有一对夫妇的更多的东西,我能做到这一点帮助,甚至更多!

#6 on YSlow says that you should move scripts down to the bottom of a page rather than at the top because it holds up the rendering of the web page if they are in the HEAD section. # 6 yslow说,你应该提出脚本下跌至底部的一个网页,而不是在最上面,因为它抓住了绘制该网页,如果他们是在头部。 I had no clue about this and had about 6 scripts that were in the head section.我也没有线索关于这一点,已约有6脚本分别在头部。 Moving the scripts down was not as simple as the other steps because you have to edit some of your plugins to have them write the “<script type=”text/javascript” src=…” in the footer section.移动剧本下跌并非那么简单,其他步骤,因为你要编辑你的一些插件,让他们写的" <剧本式= " 文/ JavaScript的而" src = … … "在页脚节。

As a note, though, you will not have able to move ALL of your scripts down to the bottom because some will simply not work!作为一个说明,虽然,你不会有能够提出您的所有脚本下跌至底部,因为有些根本行不通! Google Analytics, for example, will have to remain and I left my Subscribe Me in the HEAD also otherwise when you scroll over my Subscribe button instead of a list coming down, nothing would happen. Google Analytics功能,举例来说,将不得不留在我离开我的订阅我的头部也否则当你卷动过我的订阅按钮,而不是一个名单下来,没有什么会发生。

However, I was able to move my ShareThis, Subscribe Remind , and AJAX Edit Comments scripts to the bottom without any problems.不过,我可以提出我的sharethis ,订阅提醒阿贾克斯编辑评论剧本至底部而不会有任何问题。 Here’s how you can try moving your scripts to the footer:这里的如何,你可以尝试移动你的脚本注脚:

1. 1 。 Firstly, backup the original code or file for the plugin!首先,备份原始程式码或档案给插件! If you mess it up, you’ll need to go back to the original!如果你一塌糊涂了,你需返回原!

2. 2 。 Go to your Admin panel and click on Plugins.去你的管理面板,点击插件。 Find the plugin that YSlow is listing as an offender.找到插件即yslow是上市作为一个罪犯。 Here is an example of mine currently:这里是一个例子,目前矿井:

3. 3 。 Click on Edit to modify the plugin code.点击编辑修改插件代码。 Now do a search in your browser for the phrase “ wp_head “.现在做搜索,在您的浏览器为" wp_head " 。 wp_head is a hook that plugins can use to dump stuff into the HEAD section. wp_head是一个钩表示,插件可以使用倾倒东西到头部。 Change wp_head to ‘wp_footer’ with the single quotes.改变wp_head ' wp_footer '与单引号。 Now your script code will be moved to the bottom.现在你的脚本代码将逐步迁移至底部。 Sometimes you’ll see more than one wp_head in your plugin file, one for CSS and one for JS. Only change the JS line !有时,你会看到不止一个wp_head在你的插件文件,其中一个为CSS和一个js , 只有改变js线

4. 4 。 Save your file and test out what changes were made on the site.挽救你的文件,并测试出什么样的变化,作了关于站点。 A few minor things changed on mine with the AJAX Edit Comments, but it was nothing major, just a smaller text box.一些小事情改变了对矿山与阿贾克斯编辑评论,但它没有什么重大的,只是一个较小的文字框。

Shrink, Zip and Cache 萎缩,邮编和高速缓存

Ok, so there are two more things that I did to get me to the 50% reduction in load time: got gzip to work with wp-cache and used JSMin to shrink the prototype.js file.好吧,我们就这样,有两句话,我没有得到我要减少50 % ,负载时间:末得到工作,与可湿性粉剂-高速缓存和用jsmin缩小prototype.js文件。

Getting gzip to work with WP-cache plugin takes a little more editing of your files, so again please make sure to backup everything in case it doesn’t work.越来越末工作可湿性粉剂-缓存插件需多花一点编辑你的文件,所以再次请务必备份所有的情况下,这是行不通的。 Anyway, here’s the method I followed to无论如何,这里的方法,当时我以 update my wp-cache files更新我的可湿性粉剂-缓存中的文件 . Remember, you should still keep gzip disabled in WordPress.记住,你还是应该保持末残疾人在WordPress 。 Editing the wp-cache code makes the PLUGIN compress the JavaScript files, not WordPress.编辑可湿性粉剂-缓存代码,使插件压缩JavaScript档案,而不是在WordPress 。 So keep gzip disabled in WordPress in order for it to work.所以保持末残疾人在WordPress ,以便它的工作。

Lastly, point number 10 in YSlow is to have your JavaScript files Minified.最后一点, 10号在yslow是你的JavaScript档案minified 。 This will basically remove all comments and extra line breaks, etc from the code making it much smaller, but impossible to read.这将从根本上清除所有的评论和课外线休息等,从代码,使少得多,但不可能进行阅读。 To use使用 JSMin jsmin , download it and copy it to the root of your C drive. ,其下载并拷贝到根你的C驱动器。

Copy down the JavaScript file you want to shrink and place it in the same directory as the JSMin executable.拷贝下来JavaScript档你想收缩和它摆在同一个目录作为jsmin可执行文件。 Go into DOS and CD into the directory with the files.进入DOS和光盘目录与档案。 Type jsmin <originalfilename.js >newfilename.js to convert the file.类型jsmin <originalfilename.js > newfilename.js转换成档案。

Once the file is generated, copy it somewhere else, rename it to the original file name and replace it on your server.一旦档案已被产生,复制,它在其他地方,把它更名为原来的档案名称取代,在您的服务器上。 I was able to reduce my prototype.js file from 74KB to 54Kb using JSMin.我能减少我的档案prototype.js从74kb到54kb用jsmin 。 Unfortunately, I’m still not sure how to move prototype.js to the bottom or if it’s even possible, but if you know, post a comment.不幸的是,我还是不知道如何着手,以prototype.js底部或如果它的,甚至不可能的,但如果你知道,张贴一条评论。

Conclusion 结论

Even though my site has only a 62 when I run YSlow on it now, it’s far better than the 40 I was getting before I used it!即使在我的网站只有62个当我运行yslow上,现在,它的远胜40但是我听说前,我用它! If your WordPress blog or web site is running slow, get to working understanding the various issues involved in increasing site performance.如果你的WordPress博客或网站运行缓慢,让工作的认识涉及的各项问题,在提高网站的性能。 Doing a few of these things might save you cash if you think you need a new host or dedicated hosting.做了几年的这些东西,可能会节省你的现金,如果你认为你需要一个新的主机或专用主办。

Now it’s time for me to figure out the expires header and etags, since I got F’s on both of those!现在,它的时候,我计算出到期页眉和etags了,因为我得到f的两对那些!

Technorati Tags: Technorati标记: , , , , , ,

If you enjoyed this post, make sure you 如果你喜欢这个职位,请务必 subscribe to my RSS feed 订阅我的RSS馈送 !

» Filed Under »提起下 Web Site Tips网站提示

Related Posts相关职位

2 Responses to “How I increased by blog’s load speed by 50% using YSlow”二回应"我如何增加博客的负荷速度由50 %的人使用yslow "

      Pingbacks pingbacks
    1. Wordpress Performance verbessern - Tipps und Tricks WordPress所表现verbessern -t ippsu nd伎俩 Says: 内容为:

      […] Online-Tech-Tips […] [ … … ]在线-科技-秘诀[ … … ]

    2. Pingbacks pingbacks
    3. 7 free SEO tools to analyze and optimize your website for speed and compatibility 7免费徐工具,以分析和优化你的网站速度和兼容性 Says: 内容为:

      […] to ensure the highest possible grade. [ … … ] ,以确保尽可能高的品位。 I wrote two articles on YSlow, one about how it helped me reduce the load time of my site by 50% and another on how to setup YSlow.我写了两篇文章对yslow ,其中约它如何帮助我减轻负荷的时候,我的网站由50 % ,另一个是关于如何设置yslow 。 Make sure to read them and install Firefox just for this […]切记阅读它们,并安装Firefox的仅是这个[ … … ]

    Please post your comments/suggestions!请您评论/建议!