当涉及到您网站的性能时,页面速度至关重要。

However, unless you understand how this metric works — and, more specifically, the factors that influence it — you may find it difficult to improve.

To reduce your跳出率并增加访问者的参与度,您的网页必须快速无缝加载。

Asite that is optimized for speednot only enhances the user experience (UX) but can also help to boost your search engine rankings.

在本文中,我们将说明什么是页面速度,为什么重要以及如何衡量它。然后,我们将为您提供九种快速解决方案,您可以用来提高页面加载速度。

Let's get started!

Speed Up Your Website with HubSpot's Built-In CDN

什么是页面速度?

In a nutshell, page speed refers to how quickly your content loads when someone visits a page on your site. Not to be confused with website speed, page speed represents the loading time of a specific page.

There are a variety of factors that can influence page speed. Some of the most important include:

  • How many images, videos, and other media files are contained on the page
  • What themes and plugins are installed on your site
  • Your site's (and the specific page's) coding and server-side scripts

All of these elements affect your page loading speed and in turn your website's UX. After all, visitorsdislike slow-loading pages并且更有可能单击它们。

Why is page speed important?

当涉及页面加载速度时,每一秒都计算。实际上,Google的研究表明,当加载时间从1秒增加到三秒钟时,弹跳的可能性(访客立即离开)increases by 32 percent

如果页面需要五秒钟的加载,则反弹的概率上升了90%:

Image Source

In other words, if your pages don't load within a few seconds, it significantly increases the chance that visitors will leave your site. Additionally, if your web pages are sluggish, that can hurt your ability to drive engagement and conversions.

页面速度在Search Engine Optimization (SEO)。Google takes a wide variety of factors into consideration when deciding how to rank web pages.

However,speed is an important ranking signalfor both desktop and mobile searches.

Another reason page speed matters is because it can influence consumers' perception of your brand. If your web pages take too long to load or anything goes wrong during the process, it can make you look unprofessional, and your website unreliable.

If you want to run a highly-effective website, therefore, it's necessary to focus on optimizing page speed. The first step in doing that is figuring out how your pages are currently performing.

How to Measure Page Speed

Before making any changes to your site, you'll need to gauge your web pages' performance. There are various tools you can use totest and measure page speed。Two popular solutions arepingdom网站速度测试GTmetrix, which are both beginner-friendly options.

但是,我们建议从Google PageSpeed Insights。This is an easy-to-use tool that enables you to measure and test the speed of your web pages on both desktop and mobile devices.

另外,作为Google支持的工具,它可以帮助您确保达到高搜索结果所需的性能基准。

To use PageSpeed Insights, simply enter the URL of the web page you want to test into the text field, and select theAnalyzebutton:

Google PageSpeed Insights.

PageSpeed Insights will then analyze the content on your page, and score it on a scale of 0 to 100. Below your score, you'll find a list of suggestions on ways you can improve page loading speed:

Suggestions for improving performance.

It's worth noting that you'll get a separate score and list of suggestions for both the desktop and mobile versions of your site.

This information gives you a solid starting point for gauging how fast your web pages are, and offers tangible actions you can take to improve page loading speeds.

9种提高页面加载速度的快速方法

Now that you understand the importance of page speed and how to test your site's performance, it's time to work on improving this key metric.

With that in mind, let's take a look at nine easy ways to make your pages load faster.

1.选择一个优化的托管解决方案。

The hosting provider you use plays a major role in your website's management and performance. That includes its page speeds.

One of the worst mistakes you can make is settling for mediocre hosting in order to get a lower monthly rate.

Cheap hostingoften translates to poor performance. It can mean sharing resources between multiple websites on an overloaded server, which can end up straining your page loading times.

On the other hand, there are a handful of以性能为中心的托管解决方案you can use that provide a powerful platform designed for speed. Usually, these providers don't offer shared hosting, which means you'll never have to worry about other websites draining your pool of potential resources.

2. Compress and optimize your images.

Images help enhance the appearance of your web pages and increase the quality of your content. However, large images can also delay loading times.

Therefore, one of the easiest ways to increase page loading speeds is to compress and optimize your images. This can include changing their file formats, enabling lazy loading, and compressing images through lossy or lossless compression.

By reducing your images' file sizes, you can reduce their ‘weight', ultimately helping your pages load more quickly. There are a variety of image optimization plugins you can use for this purpose, such asWP Smush

After you install and activate this plugin, it will automatically resize and compress your images without affecting their quality. It includes features for lossless compression, lazy loading, and even optimizing images in bulk.

If you're not usingWordPress as your CMS, you might want to try withtinypng.com或者Attrock, which can reduce your image sizes anywhere from 25% to 80%, and a free website app calledSquoosh

3. Reduce your redirects.

Too many redirects on your website can really hurt loading times.Every time a page redirects somewhere else, it prolongs the HTTP request and response process.

Of course, in some cases redirects may be necessary, such as when you're moving to a new domain. However, eliminating unnecessary redirects on your site can result in significantly lower page loading times.

There are a few different ways toreduce redirects in WordPress。一种是避免在建立内部链接和菜单时创建不必要的。另一个正在确保您的Top-Level Domain (TLD)resolves with a maximum of one redirection.

If you need help identifying redirects that are incorrectly set up on your site, you can use the Patrick SextonRedirect mapper tool:

The Patrick Sexton Redirect mapper tool.

This will uncover any duplicate redirects. You can also use a tool such asScreaming Frogto identify all the redirects on your site and where they lead to. This should make it easier to identify redirects that aren't serving a purpose. Then you can delete the ones you don't need via your site's。htaccess文件。

4. Cache your web pages.

Caching is one of the most effective ways to speed up your web pages. Caching stores copies of your site's files, minimizing the work needed for the server to generate and serve a web page to a visitor's browser.

Caching your web pages can help withlowering Time to First Byte (TTFB), by requiring the server to use fewer resources to load a page.

There are various ways to cache your web pages. You can do this at the server level, meaning that your host handles it for you.

Another option is to use acaching pluginsuch asW3 Total Cache,which is a free WordPress plugin that makes caching your web pages quick and easy. After you install and activate it, simply navigate toGeneral Settings>Page Cache并选择Enable选项。

5. Enable browser caching.

Browser cachingis another form of caching you can leverage to improve page loading speeds. This technique enables the browser to store a variety of information, including stylesheets, images, and JavaScript files, so it doesn't have to reload the entire page every time a user visits it.

Similar to W3 Total Cache, WP Rocket is a powerful caching plugin you can use on your WordPress site. It employs page caching and cache pre-loading to optimize the speed of your pages, and create lightning-fast loading times. WP Rocket is a premium plugin, with a variety ofpricing plansto choose from.

6. Use asynchronous and defer loading for your CSS and JavaScript files.

Your site is made up of CSS and JavaScript files. These scripts can load either synchronously or asynchronously.

Synchronously means that the files load one at a time, in the order in which they appear on your web page.

使用此方法,当浏览器遇到脚本时,它将停止在页面上加载其他元素,直到首先加载该文件为止。

Conversely,asynchronous loading同时支持多个文件加载,which can speed up the page's performance. Setting this up involveseliminating render-blocking resources

If you're using WordPress, you could either use a combination of the Autoptimize and Async JavaScript plugins to take care of this task easily.

7. Minify CSS, JavaScript, and HTML.

Optimizing the way your files load can help improve page loading speed. Similarly, so canminifying your CSS, JavaScript, and HTML code。This means removing unnecessary spaces, characters, comments, and other unneeded elements to reduce the size of the files.

减小文件的尺寸也使组合更容易。结果是更清洁的代码,而加载更快的更精细的网页。

当然,为您的每个网站文件的每个代码梳理都不是完全有效的。

Instead, you can minify your CSS, JavaScript, and HTML with a free plugin:Autoptimize代替。这个流行的插件很容易aggregate and minify your scripts and styles automatically:

The Autoptimize WordPress plugin's settings.

Considering the wide variety of features and settings it offers, configuring this plugin can be a bit overwhelming at first. To make your job easier, feel free to check out this guide onhow to set up Autoptimizeon your website.

8. Leverage a content delivery network (CDN).

A内容输送网络(CDN), also referred to as a ‘content distribution network', is a network of servers that can help improve page loading speed. It does this by hosting and delivering copies of your site's static content from servers located across the globe.

A CDN works with, rather than in place of, your host. In addition to the server that hosts your primary website, you can leverage a CDN to distribute copies of your site's files among strategically-chosen data centers.

This can maximize performance, by reducing the distance data requests have to travel between browsers and your host's servers. By loading the content for a web page from a server close to each visitor, a CDN helps reduce network latency and produce lower TTFBs.

You have avariety of CDN options to choose from, one of which is opting for ahost that provides a CDNyou can enable it directly from your own dashboard.

9. Eliminate unnecessary plugins.

Not all plugins are created equal. Having too many plugins on your site can cause unnecessary bloat that slows it down.

Additionally, plugins that are outdated or aren't well maintained can pose asecurity threat,甚至引入兼容性问题,以阻碍性能。

Therefore, it's a smart idea to minimize the number of plugins you use on your WordPress site. Of course, one of the easiest ways to do this is bydisabling and deleting any pluginsyou don't currently use.

We also recommend reviewing the plugins you have installed, to evaluate whether they're actually necessary. There might be some tools that have overlapping functionalities and features, and others that are simply no longer relevant to your needs.

Finally, certain plugins may slow your site down more than others. To identify any plugins that are reducing your page speeds, you can try testing them individually.

First, deactivate all of your plugins (it's safest to do this on a staging site):

Deactivating WordPress plugins.

然后将它们一个接一个地重新打开。每次激活插件时,都会使用速度测试工具(例如PagesPeed Insights)来查看您的分数和时间是否受到影响。

Many plugins might increase your page speeds by a small margin. However, if you see a sudden large increase, it may be time to find an alternative tool that serves the same purpose (but is better optimized).

Ultimately, reducing page loading speed improves not only the overall performance and UX of your website but itsSEO也是如此。Luckily for you, there are a variety of methods you can use to decrease your loading times.

In addition to leveraging a CDN and caching your pages, you can use plugins to optimize your images, defer loading scripts, and minify your site's files.

Using ahosting solution optimized for performance也可能对您网站的速度产生重大影响。

Remember, though — every second your web pages take to load drastically increases the chance your visitors will leave. How long will you able to run your business while losing leads?

新的呼吁行动

cdn

Originally published Oct 15, 2020 1:00:00 PM, updated June 13 2022

Topics:

Website Performance