10 tips to help you improve your website's speed of access

Source: Internet
Author: User
Tags website performance

The speed and performance of the site is very important for the user experience. If your site is very slow to access, you will not only lose users, but also be more fearful that you will lose potential customers. Internet giants like Google also use the speed of website visits as a parameter in ranking. So when you need to optimize your website speed, you need to consider every aspect of each millisecond. Here are some basic and general suggestions for improving website performance.

1, if possible, delay loading some content

You can use AJAX to load parts of your content on demand. For example, a photo album, the user can browse the page first out of the thumbnail, when the user clicked, and then asynchronously request the original image and display, so that if the user only need to see a few pictures, you do not need to wait for all the pictures are loaded down. This development pattern is called lazy loading.
Ajax/web development libraries such as jQuery, Prototype, and mootools can make lazy loading easier to implement.

2. Using external JS and CSS files

When the user loads the page for the first time, the browser caches the external CSS and JavaScript files, so it's better to put JavaScript and CSS in the external file than inline.
Using inline CSS also increases the rendering time of your Web page, so that all styles are defined in your main CSS file so that the browser renders the page less work, because it knows all the style rules that need to be applied at the outset. Also, using external JavaScript and CSS files can help maintain code.

3. Using the cache system

If you find that a Web site is always connected to a database to query for the same results, you may need to use a caching system. With caching, you only need to generate a specific content at a time without requiring the user to generate it every time you access it. The cache system also refreshes the cache periodically, depending on the configuration. You can generate static HTML pages to reduce server script execution, or use database and service-side script caching systems, such as PHP accelerators, memcached, and so on.

4. Avoid changing the image size in HTML

If a picture is originally 1280*900px, but you need it to be displayed as 400*280px, you should use the image editor, such as Photoshop, to change its size instead of using the width and Height properties of the HTML.

5. Do not use images to display text

The text in the picture is not only unfriendly to the user (unable to copy, etc.), it is not good for SEO, and using the picture to display the text will increase the page load time. If you need to use a lot of custom fonts in your site, consider using CSS's @font-face feature to more efficiently represent a particular font.

6, use the correct file format to optimize the image size

By selecting the correct diagram format, you can optimize the image size without losing the image quality. For example, unless you need a PNG-provided picture to be transparent, JPG can generally display the picture realistically in the case of smaller files.

7, optimize the way to write code

Check your source code to see if all the tags are needed, or if you can use CSS instead. Effective writing code not only reduces the size of HTML and CSS files, but also facilitates maintenance.

8. Loading JavaScript at the end of the document

All scripts are loaded at the end of the page, which allows the browser to render everything before loading JavaScript. The browser blocks the loading of the following content before JavaScript is downloaded. If you can, try to place JavaScript next to the body end tag.

9. Use Content distribution Network (contents Delivery NETWORK,CDN)

The speed of the site and the user relative to the location of the server has a great relationship. Distributing content to a different geographic location may alleviate this problem. Using a CDN may increase costs, but the benefits are obvious.

10. Optimize the page cache

Now that you are using a caching system, you should use as many caching techniques as possible. A Web cache is a browser-side cache of files that are then accessed by the user. Browsers can cache content including CSS files, JavaScript files, and pictures.

In addition to putting CSS and JavaScript on multiple pages in an external file, there are many ways to ensure that the file cache is the most important. For example, you can set the HTTP response header to expires and last-modified to reduce the number of times a particular file is re-downloaded when a user accesses your site again.

Source: http://sixrevisions.com/web-development/site-speed-performance/

10 tips to help you improve your website's speed of access

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.