14 Tips for optimizing web site loading speed

Source: Internet
Author: User
Tags browser cache keep alive

14 Tips for optimizing web site loading speed

Optimizing the loading speed of the site can not only improve its search engine rankings, but also reduce the site bounce rate, improve its conversion rate, but also provide a better end-user experience, which is today based on the success of the Web environment key.

I'll show you a few simple ways to optimize the speed of your Web site loading, and take a Look.

1. Server Response Time

Even if the site is optimized, it will not have much effect unless the server responds very quickly. When it comes to improving the speed of the website, the server response time plays an important role. Here are some tips to improve server response Times.

    • Have a separate server instead of a shared/managed server.
    • Improve the quality of your web Server.
    • Remove unnecessary plugins, only those necessary plugins need to remain enabled.
2. Browser cache

Browser caching can reduce HTTP requests, which in turn increases the load speed of your web Site. Here's How to use the browser cache for code examples:

<ifmodule mod_expires.c>expiresactive onexpiresbytype image/jpg "access 1 year" expiresbytype image/jpeg "access 1 Year ' Expiresbytype image/gif ' access 1 year ' Expiresbytype image/png ' access 1 year ' Expiresbytype text/css ' access 1 month ' Expiresbytype text/html "access 1 month" expiresbytype application/pdf "access 1 month" expiresbytype text/x-javascript " Access 1 month "expiresbytype application/x-shockwave-flash" Access 1 month "expiresbytype image/x-icon" access 1 Year " ExpiresDefault "access 1 month" </IfModule>

Note: If the expiration time is linked to a file and the contents of the file need to be changed, the file must be renamed so that the browser can get the newly added Code.

3.gzip compression

Gzip compression is a compression utility that we can use to quickly load Websites. It works by compressing the file size before sending HTML and CSS files to an Internet Browser. To allow the Mod_defalte module to enable gzip compression, here is a code example of how to use It:

<ifmodule mod_deflate.c># Compress HTML, CSS, JavaScript, Text, xmladdoutputfilterbytype deflate application/ Javascriptaddoutputfilterbytype DEFLATE application/xhtml+xmladdoutputfilterbytype DEFLATE application/ Xmladdoutputfilterbytype DEFLATE text/cssaddoutputfilterbytype DEFLATE text/htmladdoutputfilterbytype DEFLATE text/ Javascriptaddoutputfilterbytype DEFLATE text/plainaddoutputfilterbytype DEFLATE text/xml# Remove Browser Bugs (only Needed for really old Browsers) browsermatch ^MOZILLA/4 gzip-only-text/htmlbrowsermatch ^mozilla/4\.0[678] No-gzipbrowsermatch \bmsie!no-gzip!gzip-only-text/htmlheader Append Vary user-agent</ifmodule>
4. Asynchronous Scripting

There is also an awesome choice that can improve the speed of your Site's pages by loading scripts asynchronously. As a result, the Web page load does not have to rely on these asynchronous scripts, and site visitors no longer have to have to restrain their patience, waiting for all scripts to be loaded before they can render the Page. In asynchronous mode, scripts are downloaded in the Background. In general, we will use Third-party scripts as asynchronous scripts, because downloading these scripts often makes the site very slow.

<script Async src= "http://www.yoursite.com/script.js" ></script>
5. Content Distribution Network (CDN)

A content distribution network (CDN) is a network of servers located in different geographic locations. Each server has a copy of the file for all Sites. If a site visitor requests files and pages, it can be sent directly from the nearest Web server (or from the server with the least load).

6. Optimize javascript, html, and CSS

Optimizing JavaScript and CSS can also improve the speed of a Web site, and this is a very simple method. Optimizing javascript, html, and CSS removes all unnecessary whitespace and comments, reducing file Size. Here are some of the most popular tools for minimizing JavaScript and css, which are Useful.

    • CSS Minifier
    • Avivo
    • HTML Compressor
7. The top style sheet and the script at the bottom

Putting the stylesheet on top helps the site to load quickly, because it allows the Web page to be rendered incrementally. generally, all Internet browsers support downloading two components (images, styles, and scripts) in parallel at a given Time. however, in general, the overbearing script will block other downloads when it is downloaded in parallel, until the script is Downloaded.

8. Avoid blocking JavaScript and CSS

Before a browser renders a web page, it first needs to construct a DOM tree by parsing the HTML markup language. In this process, if a script is encountered, the process is aborted and the script is executed before the previous activity is Resumed. It is recommended that you avoid blocking javascript, especially external scripts.

Blocking JavaScript can also cause a Web site to be delayed. So you might want to postpone loading those unimportant javascript, or use asynchronous Loading. Another option is to embed these HTML code on your Web site, and you need to ensure that the CSS is Optimized.

Latency resolution for 9.JavaScript

In order to load the Web page, the browser must parse all the <script> tag content, thus increasing the load time of the Website. By delaying parsing the script, you can reduce the load time of the initial web Site.

10. Enable Keep Alive

When a user requests a Web page through a browser, the browser first needs to access the HTML File. It can then read these files and request to be associated with other materials (the data here may be css,javascript or any related image).

If the "Keep Alive" option is banned, the process of downloading the Web site usually increases, which slows down the Website. Another benefit of enabling keepalive is that it can reduce CPU Usage.

Syntax: KeepAlive on
11. Images and file formats

Images are very valuable to any website because it conveys some powerful information to visitors to the Site. The most common image formats are gif, JPEG, png, and so On. Each of these formats has its strengths and limitations. It is recommended that you use the JPEG format instead of GIF and PNG images unless the image contains an alpha factor or is Transparent.

12. Optimize code: do not use inline CSS

Inline styles do not clearly separate the content from the DESIGN. At the same time may also need a lot of maintenance work, to the webmaster inconvenience, but also further increase the size of the Page.

13. File Separation

The files of the website can be divided into css, javascripts and Images. File separation does not directly improve the load time of the Site. however, This can improve the stability of the server, especially when the site traffic suddenly appear spikes. Subdomains can also be used for managed files, which can increase the number of concurrent DOWNLOADS.

14. Minimizing HTTP Requests

There is also a simple way to optimize page speed by reducing the HTTP Request. When a Web site receives too many HTTP requests at a time, its visitors have an experience of responding to a delay, which not only increases the CPU usage but also increases the load time of the Page. so, How do you reduce the HTTP request? Please see the steps below.

    • Reduce the number of objects on your Site.
    • Minimize the number of redirects on the Site.
    • Use CSS Sprites technology (as long as you need that part of the picture content).
    • Combine javascripts and Css.

The above recommendations have proven to be very effective in optimizing the page loading speed of your Website. In short, dazzling graphics, interesting content and better navigation can help you get more site visitors, but faster page loading speeds can help you keep them.

English original: 13+ Ways to Optimize Your Website's Page speed translation: Codeceo

Harbin Product Software co., Ltd. is committed to Harbin's small and medium-sized enterprises to produce the atmosphere, beautiful and excellent website, and can build a website in line with Baidu ranking standard base, so that your site without additional costs, you can steadily improve the ranking to the home Page. Welcome to experience the best Harbin website Construction.

14 Tips for optimizing web site loading speed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.