How to solve the impact of CSS JS and pictures on the loading speed of the website

Source: Internet
Author: User
Keywords To solve or to affect

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

For the web site loading speed of the strict requirements of the SEO process is the focus, how to enhance the speed of the site loading, server, site content elements, etc. have a great relationship, this article will be from the CSS JS and picture Three aspects of detailed explanation.

1. Picture

(1) Specify image size

Your browser starts rendering the page before loading the image. Develop an image dimension to help it wrap around irreplaceable elements. If the size is not developed, once the image is downloaded your browser will reflow, in order to do this, I recommend the use of Height and width label specifications in < IMG > elements.

Note Do not use the size scaling function of the image, because the user still needs to download the original file size, I think, in fact, the image does not need much screen space, as long as the user can see clearly.

(2) Optimize the image

In the process of using the image, there are some extra things, such as using some unwanted colors, extra picture sizes. Optimize it before use, keep the size to a minimum, try to save the JPEG format, which will help many slow network users. The reason for this is to control the weight of the image while maintaining the quality of the picture, reducing the load time of the server.

2. Avoid CSS expressions

The HTML page progress indicator indicates that the the process of the browser loading page is gradually from the page header, navigation bar, content, etc., if you put the CSS file at the bottom of the page, will still many browsers to render, these browsers prevent rendering will cause the page is redrawn, use CSS files need to place it at the top of the page, and CSS files avoid using CSS expressions.

CSS expressions are a powerful and dangerous way to set CSS properties dynamically. They support starting with Internet Explorer version 5, but are starting to discard with IE8. As an example, you can set the background color alternately using CSS expressions every other hour:

gethours Background color: expression (new Date ()) () 2% "b8d4ff#": "#F08A00"); CSS expressions will add a translation time to the page and extend the load time of the page.

3, the use of external JS and CSS files

Using external files in the real world typically results in faster web pages, because browsers are cached by JavaScript and CSS files. JavaScript and CSS are the time required to download HTML files in an HTML document. This reduces the number of HTTP requests required, but increases the size of the HTML document. On the other hand, if the cached file in the external browser, the size of the JavaScript and css,html document does not increase the number of HTTP requests reduced.

Original article is by: http://www.leadseo.cn/seogongsi/dongtai/webmaster start, reprint please keep valid link address, thank you!

Related Article

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.