Optimization of a temporary page

Source: Internet
Author: User
One day, the manager makes a statistical temporary page about the sales performance of the company on the TV, to the customers to visit the day to watch. First stage: Scenario: temporary function, small data volume, simple SQL, short development time. Countermeasures: All things are placed in a controller inside, JS and CSS and other data written in the view layer, data real-time query. The company's rapid development, this temporary page since put on the television has never come down (I have a feeling of the pit (⊙﹏⊙) b), and the boss required a lot of new data added, the page has been redesigned. Second Stage scenario: the data volume increases, the SQL becomes more and more complex, at the peak of the system load, the data real-time query has caused the great pressure to the database. Countermeasure: Optimize SQL, add appropriate index, page increase data cache function. Six months later, this temporary function is still alive (⊙﹏⊙) b, the company's various departments want to show their own data on the above. The third stage scenario: Leaders demand increased data, data is more complex, query SQL is very slow, resulting in very slow page opening. Countermeasures: Because of the real-time data before the day of the requirements are not high, so the data before the day using timed scripts, every morning statistics good, deposited in the statistics, the day of real-time data query timing query. From the view layer to separate JS, CSS and other files, compressed page pictures, JS, CSS and so on. A year later ... The fourth stage scenario: A surge in demand, more data to show, more complex data, a very slow page opening, and sometimes 30 seconds is not necessarily open. Countermeasures: Reduce the host controller, separate complex data, use lazy loading, local refresh, page increase fragment cache. Page load, load the whole page frame and simple data, so as to ensure the opening speed of the page, the complex data from the main controller, to reduce the load time of the host controller, local complex data, such as the entire page loaded through Ajax from the background.

Optimization of a temporary page

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.