如何加快您的網站以獲得更好的搜索排名

文章撰寫者:
  • 搜索引擎優化
  • 更新:Apr 24,2018

*注意:這篇文章於3月2013首次發布。 我在這裡提到的一些工具可能已經過時了。

谷歌現在使用網站速度作為排名因素之一已經不是什麼秘密了。 谷歌網站管理員中央博客幾年前正式宣布:

You may have heard that here at Google we're obsessed with speed, in our products and on the web. As part of that effort, today we're including a new signal in our search ranking algorithms: site speed. Site speed reflects how quickly a website responds to web requests…

並且,Matt Cutts一再提到網站速度優化的重要性 視頻 - 博客.

在搜索和閱讀有關該主題的更多內容時,我碰到了幾個案例研究,證實了這一點 - 在一個案例中 關於搜索引擎觀察的文章,Work Coach Cafe在清理其代碼和斷開鏈接後獲得了額外的40%有機流量; 另外一個 案例研究SmartFurniture.com首席執行官證實,該網站僅通過提高網站性能就在搜索引擎排名方面取得了巨大的優勢。

更快的頁面加載時間也等於更好的轉換

但是等等,有更多的理由說明為什麼你需要花時間來加速你的網站。

在一項關於旅遊網站用戶的研究中,我了解到57%的網站用戶在放棄網站之前只會等待三秒或更短時間。

塔曼的熱門研究,它表明頁面加載時間增加一秒可能導致客戶轉換幾乎損失7%。

在Cloud Living的另一個案例研究中,網站訪問者參與度在網站速度優化後提高了19%(平均會話持續時間,見圖像)。

站點更快=每個會話更多頁面訪問次數和更長的會話持續時間。 資源: Tung Tran,CloudLiving.com。

簡而言之,頁面加載時間不僅會影響搜索排名,還會對轉化率和訪問者覆蓋率產生很大影響。 有關更多類似的統計信息,請務必訪問Mashable 美麗的圖表.

簡單的方法來提高您的網站速度

When I first learned about all these two years ago, I was like “Wow, there's so many benefits in this!”. What's come next is inevitably the question ‘how'. How do we speed up our websites? How do we measure the speed of our website and compare with others? How do we get things done without getting into too much technical details?

Ian Lurie寫道 29如何加速您的網站 back in March 2011 and it's a true gem. If you are serious about tweaking your website speed, you should follow every single tips shared in the article.

然而,許多這些解決方案可能超出了日常網站所有者和博主的技術技能。

So I thought I'd revisit on this topic and look for simple ways and so the non-techie users can implement without pouring too much of time and energy.

1。 減少你的網站

在很多時候,頁面加載時間很慢,它只是意味著頁面超重。

解決方案很簡單:節食!

仔細檢查您的網站並問自己以下問題:

  • 你在服務器上保留了太多未使用的CSS嗎? 刪除它們!
  • Are your images too large? Optimize them with Photoshop, Fireworks, or Smush It if you don't have a graphic software installed in your PC.
  • 您是否擁有過多的HTTP標頭? 刪除它們!
  • 你收到太多的垃圾評論嗎? 垃圾郵件框中未刪除的評論只會減慢數據庫響應時間。 盡快刪除它們!
  • Are you using too many plugins on your CMS? Are you using outdated plugins and scripts on your site? Well then it's time to do some clean up and updating job.
  • 你的JavaScript太重了嗎? 縮小並壓縮它!

While these tips seem pretty simple, I won't be surprise to see experienced webmasters or web designers fail to keep up with it.

A few years back I was careless and I wasn't aware that the WordPress theme I am using has a <?php wp_get_archives(‘type=monthly'); ?> embedded in the header.php file.

Needless to say, the function generates dozens of unnecessary lines in HTML files as time goes. It's a silly mistake that can be fixed in seconds, but then it took me more than 2 years to realized it as I wasn't looking on my own source code.

2. Avoid Unnecessary HTTP 300's, 400's and 500's

HTTP 300's refers to server redirects, HTTP 400's refers to authentication issues, and HTTP 500's refers to server errors – all these results for HTTP requests cause unnecessary extra round trips* for the browsers. While certain HTTP 300's are unavoidable (such as 301 redirection to a new page location), you should look into every HTTP 400's and 500's errors and try to fix every one of it.

* What's A Round Trip Time Anyway?

一般來說,網頁大小約為1,100KB,大致由100對象組成(來源); a web browser can only request 2 – 6 objects at a time depends on user's configuration. Round Trip Times is the number of round trip it takes for a browser to open up a page completely. For example, In order to load a webpage with 100 objects, a browser that is configured to carry 5 requests at a time will takes 20 round trips to load the webpage. Since the lesser round trip times it takes, the faster a webpage loads; we should minimize the number of objects available on one page.

3。 使用CSS Sprites

CSS Sprites是指將多個圖像組合成一個圖像文件並一次向用戶顯示部分圖像的技術。 使用CSS Sprites減少了往返瀏覽器的數量,從而使網頁加載速度更快。

Now wait, I know this might seems a little too much for some of you who don't like to get your hands wet on CSS but trust me, the concept is much simpler than it sounds. And, best of all, there are free tools online that can get things done without touching the CSS codes. Check out 雪碧我 - 精靈墊 - 只需幾次拖放和點擊即可完成任務。

精靈墊

精靈墊

雪碧我

雪碧我

另外,有關CSS Sprites的進一步閱讀和示例,請訪問 - 教程。

4。 避免使用CSS @import

CSS @import函數有助於將外部樣式表加載到您的網頁。 這樣做的壞處是它只是增加了額外的瀏覽器往返時間並增加了網頁加載時間。 要解決此問題,只需使用<link>標記即可。

In case you are a casual blogger and have no idea what am I talking about, just go have a look on your header.php (if you are using WordPress), ctrl + F and search for ‘@import', move .css files to the same server if necessary, replace @import lines with <link> instead.

例如,替換

@import url(“../ style1.css”); @import url(“../ style2.css”)

<link rel =“stylesheet”href =“style1.css”> <link rel =“stylesheet”href =“style2.css”>

5。 更新您的CMS

那麼這是一個不用腦子的吧? 更新旨在提高性能和安全性,您可以為訪問者做的最少的事情是將它們保存在更新的CMS平台上。

6。 緩存所有你可以緩存

These days in most cases I rely on a third party plugin for caching. For one, I am too lazy to look into it; secondly, there are pros that can do things much better than me, why waste my energy in this? In case you are on WordPress, try WP Super Cache – it's one of the most popular cache WP插件 在這個時候寫作。 如果你是Joomla,請退房 緩存清理.

簡而言之,這些插件有助於緩存最新版本的網頁,並減少重複訪問期間生成動態內容的需求。

在這個主題中有很多技術細節需要處理,請隨時閱讀更多內容 點擊瀏覽,獲取更多資訊 - 點擊瀏覽,獲取更多資訊.

7。 進入內容分發網絡(CDN)

A CDN stores your static files across servers worldwide and serves your web pages from different servers based on user's location. Example, when a user from Malaysia access to your website, the CDN will delivers your web content (mainly static files like images and HTML files) from the server located in Asia, say Singapore; on the other hand if the user is located at Mexico, the network will choose to deliver the content from a nearer server location, say United States.

有不同品牌的CDN可供選擇,但一般來說CDN可以分為兩類 - 拉CDN和推送CDN。 有關詳細信息,我建議您查看一些著名的CDN服務,例如 MaxCDN - CloudFlare的.

8。 考慮一個更好的Web主機

如果您認真考慮更快地調整網站,請考慮 選擇一個更好的主機.

大約一年前,我將我的一個網站從Hostgator的共享主機帳戶切換到 WP發動機 (基於雲的託管)。 自從我搬家以來,事情發生了巨大的變化,平均頁面加載速度從900ms減少到500ms - 幾乎增加了100%(見下圖)。

WHSR頁面加載速度

Lesson learned: Sometimes you just can't rely on the cheap stuffs. If you are paying less than $5 per month, don't expect to get on top of this speed game. If you want your website to load lighting fast, perhaps the easiest way to do so is to shift your website to a better web host.

9。 優化您的數據庫

如果您使用的是MySQL,可以在phpMyAdmin上輕鬆完成。 如果您使用的是WordPress,使用正確的插件可以更輕鬆地完成任務。 WP Optimize例如,您只需單擊幾下即可清理數據庫。

10. Place Your Scripts At The Footer Whenever It's Possible

在訪問者視圖中改善頁面加載時間的一種簡單方法是盡可能在頁腳中放置代碼和腳本(例如,Google Analytics)。 雖然我認為它在搜索引擎優化方面幾乎沒有幫助,但這樣做會使您的網站查看者感覺頁面以更快的方式加載 - 因為這允許在瀏覽器執行腳本之前加載關鍵內容。

關於加速網站的更多提示

在那裡,您現在可以獲得有關如何提高網站速度的10快速提示。

I am sure there are many other methods to get the job done, why not tell us yours – What's your #1 tips for a non-techies to speed up their websites?

關於Jerry Low

WebHostingSecretRevealed.net(WHSR)的創始人 - 100,000用戶信任和使用的託管評論。 超過15在網絡託管,聯盟營銷和SEO方面的多年經驗。 ProBlogger.net,Business.com,SocialMediaToday.com等的貢獻者。