Front-end optimization, secrets unknown to search engines

Source: Internet
Author: User
Sometimes, do you find that after a website is operated for a period of time, the page indexed by the website will not grow any more, but will remain in the range of values, no matter how you update your page, the indexing of external links has not changed much. Have you considered the reason? The time when crawlers come to your website every day is actually a fixed value. it is determined by the weight of your website.

Frontend: simply put, the website page we usually see is the frontend. So what are the benefits of the front-end for our optimization?

Factors that affect front-end optimization include code slimming, fast page opening, user liking, and search engine liking. Sometimes, do you find that after a website is operated for a period of time, the page indexed by the website will not grow any more, but will remain in the range of values, no matter how you update your page, the indexing of external links has not changed much. Have you considered the reason?

First, the premise of website indexing is that the website is crawled by search engine crawlers. It takes some time, even 0.1 seconds, for crawlers to crawl a page. Generally, hundreds of pages are invisible to websites, but as long as the number of pages exceeds 2000, the indexing problem may easily occur.

The time when crawlers come to your website every day is actually a fixed value. it is determined by the weight of your website. Suppose you have a website (http://www.nowamagic.net) with a weight of 10, crawlers will require 2 hours a day to crawl the page of your website, calculate, if the time for downloading a page is 2 seconds. So how many pages can be crawled by crawlers? The quantity is very limited! Let's take a look at 2*3600/2 = 5400. In fact, crawlers need to consider the load of your server. After crawling a page, you have to stop it to avoid affecting the use of normal visitors. a website with a low weight may need to be 3 ~ 4 seconds to capture a page. Therefore, if your website has a low price, crawlers may have a shorter crawling time.

In this way, every day crawlers can see very limited pages. The number of entries will naturally cause the problems mentioned above. To sum up, we will increase the total crawling time of the website Spider and the decisive factor for increasing the crawling frequency of the Spider:

First, the weight of the website.

Second, the speed at which the website webpage is opened (that is, the frontend optimization ).

Articles about website weights are everywhere on the internet. There are a wide variety of statements, some of which are messy and some are justified. Today we will not talk about the weight, because the weight issue is a common topic. next we will talk about the second point: improving the speed of opening websites. How can I get more crawlers for my website with limited time?

This requires the front-end optimization technology to help crawlers crawl websites faster. it may take 2 seconds to crawl a page. After optimization, it may take 0.5 seconds, the number of pages that the website crawls every day may be 200% ~ 300% improvement.

We normally access a webpage, which involves five steps.

  1. DNS domain name resolution
  2. Establish a connection with the server
  3. Content returned by server computing
  4. Download content to local
  5. The browser processes the downloaded content and presents it to the user.

During each stage, optimization is required if the total time exceeds Ms. When we are doing front-end optimization, we should first find out where our website is slow, and the optimization will be more targeted.

The following describes the specific optimization rules:

(1) simplified CSS code.

The abbreviation here mainly solves the problem of website code redundancy and unnecessary spaces. If you can use a language, do not add a few lines of code that meets W3C standards.

For example, the longest-used margin is a combination of multiple attributes:

margin-left:2px;margin-right:4px;margin-top:8px;margin-bottom:6px;

Can be abbreviated as margin: 8px 4px 6px 2px;

Remove unnecessary space keys to effectively reduce the number of bytes on the webpage. For example:

.a{Font-size:14px;Border:2px solid red;Padding:1px 2px;}

Can be abbreviated as:. a {Font-size: 14px; Border: 2px solid red; Padding: 1px 2px ;}

(2) same attribute proposal

If two styles have the same attributes, you can submit the same attributes separately. For example, A style and B style have the same font color, size, and border. For example:

.gongyong{font-size:12px;border:1px solid red}.yangshi{ width:10px;}.yangshi2{width:20px;}

(3) clear structure optimization

Website code clearness refers to code partition processing: Website head, body, footer, and three regions for different la s. Code in different intervals must differentiate the general selector and separate them with different colors.

Conclusion: The front-end code of a website is evaluated by 20% by search engines. The code is simplified and the crawling Directory has a low level. this enhances the code friendliness of the search engine and increases the weight of the website so that the keywords can rank well. If code redundancy is cumbersome, search engines will be less concerned.

This article is available at http://www.nowamagic.net/librarys/veda/detail/1750.

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.