Front End-"learning experience"-improved mobile performance by 3

Source: Internet
Author: User

In the previous share, the writing cache can greatly improve the performance of the application. Cache applications In addition to the JS code will need the appropriate server configuration

such as Nginx configuration http://linux008.blog.51cto.com/2837805/547236

Here is the detailed description, of course, sometimes we do not want their servers to be proxy cache, then we can set the cache header expires after one hours, can be written as

Location/{

Expires 1h;

}

This configuration after our server returned to the browser header contained in the cash-control:max-age=3600, then when the site within 1 hours of frequent access will have a greater performance improvement, and because 1 hours is not long, but also to ensure that the content is newer.

Below is a description of networked storage, Web Storage This is to compensate for the undesirable move of the cache environment, the networked storage provides a way to store persistent data in addition to cookies. Networked storage provides 5MB of storage space for each domain in the form of key values.

The networked storage API includes Localstorage Sessionstorage, such as the ability to write:

var a=localstroage[' B '];

    localstorage[' B ']=c; removal is localstorage.removeitem (' key '), but it's not as safe as a cookie, This means that the user can make changes to it.

The use of this cache is with memory, that is, if we get the data stored in the network storage and memory, (memory storage for your own definition of an object such as Var a={}), the time to get the data from the content, if not to go to the network storage to take, Perhaps your question is why it has been put in memory and then use such a network storage, because our data is out of date nature, the placement of data and data when the time lag, so that the memory of the data expires in the network storage to take, the data in the network storage expires to remove it.

Front End-"learning experience"-improved mobile performance by 3

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.