How to speed up Website access

Source: Internet
Author: User

I. Use Div + CSS in website programs without table
  
Currently, div + CSS is the mainstream programming language, which is closely related to its advantages of small size and fast loading. Mainstream websites and CMS also adopt this mode. Therefore, we recommend that you use this mode instead of the original table structure. The table structure is not only inconvenient to manage, but also increases the size of the webpage, reducing the loading speed of the website.
  
2. Use gzip technology to compress webpages
  
Using gzip technology to compress webpages is a good way to reduce the volume of webpages. generally, this requires the support of your website space. For example, if I use an A5 shared host, the compression rate can reach 80%. The page size is small, and the loading speed is faster.
  
3. Reduce the number and size of CSS files
  
In the process of using Div + CSS, CSS files are very important. If there are multiple CSS files in the compilation process, we recommend that you merge multiple CSS files to speed up website loading. In addition, professional Web slimming software can be used to reduce the size of CSS files.

4. Use CDN acceleration.
CDN has heard a lot in our personal webmaster in the past year, and many friends are using it. CDN stands for content delivery network (CDN. The principle is to avoid bottlenecks and links on the Internet that may affect data transmission speed and stability, so that content transmission is faster and more stable. That is, the website accelerator, which requires payment, is not too stable for free.

5. Optimize the code to reduce the bloated structure.
If we use the popular CMS, there should be no bloated code structure, but it should be noted that there will be an unreasonable structure when we make or select the website template. We need to use a concise program framework when writing templates or programs, which is conducive to user experience and crawling of search engine spider.

6. Reduce the image size and quantity.
We try our best to reduce the size and size of the images when uploading website images. We can compress the images before uploading them. the appropriate size of the images should be enough. Images are just the embellishment of websites, and they do not need to be images. At the same time, we also try to avoid using a large amount of video or audio content.

7. Reduce Javascript script files and store them in one file as much as possible.
Try to call JS Code externally, do not put it on a webpage, or remotely call external JS Code. For example, Google suggests that you load the analysis on the head tag. You can also try to combine JavaScript and compress them to load faster. Sometimes we have too much CSS and JS Code in the header, resulting in slow loading of the intermediate content. Therefore, reduce the header code as much as possible.

8. Using Static HTML pages as we all know, ASP, PHP, JSP, and other sequences have completed static interaction of webpage information, which is indeed very convenient to operate. Because of their good data interaction, the database content can be easily accessed and changed, but such order also has its own defect, that is, it must be converted into an HTML page by the server, and then "transmitted" to the user, an extra step will definitely affect the website visit speed. Therefore, I suggest using static html pages during the important investigation period of my website at the beginning of the new website.


9. Change ASP, aspx, PHP, and other files to. js references.
This should be noted in programming such as ASP, aspx, and PHP. If dynamic data needs to be embedded in Static HTML pages, if these dynamic data is provided by ASP, PHP, and other programs, the following statements are used for reference:
<SCRIPT src = "http://image.ccidnet.com/ad_files/network_index.asp? Orders = 1 "> </SCRIPT>
In this way, each time a person accesses your website, the server will execute and process the network_index.asp file, extract the corresponding data from the database, and then output the data to the webpage, if tens of thousands of people access the website at the same time, tens of thousands of requests are required. We recommend that you dynamically generate data to a network_index.js file in these programs, and then
<SCRIPT src = "http://www.179job.com/ad_files/home_daohang/network_index.js"> </SCRIPT>
This code references the network_index.js file. In this way, the data display task is handed over to the browser of the client, which does not consume server resources and the display speed is naturally fast. The former takes almost several times as much time as the latter!

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.