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!請您評論/建議!