如何加快您的网站以获得更好的搜索排名

文章撰写者:
  • 搜索引擎优化
  • 更新: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服务,例如 MaxCDNCloudFlare的.

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优化例如,您只需单击几下即可清理数据库。

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等的贡献者。