Learn what skills will be front-end Web browser cache is how is it

School Web front-end will be what skills? Browser cache is how is it? Cache system is now essential module is a key component of high-performance concurrent architecture. Cache is suitable for less demanding real-time data as well as performance-critical scenarios, can effectively improve performance, ease pressure data. For front-end Web developers, mainly with the browser's cache to deal with, then Xiao Bian gave you explain the browser cache mechanism.


Learn what skills will be front-end Web browser cache is how is it



What is browser cache?

Browser cache mechanism, in fact, is mainly defined by the HTTP protocol caching mechanism (such as: Expires, Cache-control, etc.). But there are also non-HTTP protocol definition caching mechanism, such as using HTML Meta - tags, Web developers can add a tag to the HTML page node, the code is as follows:

The role of the code above tells the browser the current page is not cached, every access need to pull the server. The use of very simple, but only part of the browser can support, and all caching proxy servers do not support, because the agent does not parse the HTML content itself, but is still widely used HTTP headers to control caching.

Browser cache for the requested resource processing a complete set of mechanism, consisting of three major strategies: storage strategy, the expiration policy, negotiation strategies. Storage policy in response to receipt of the request for deciding whether to cache the appropriate resources; expiration policy occurred before the request for judging whether the cache has expired; negotiation strategies occur in the request for judging whether to cache resource update.

Cache is divided into strong and weak buffer cache (also known as negotiation cache). Which includes a strong cache Expires and Cache-Control, it is mainly applied when the cache expiration policy to take effect. Weak cache includes a Last-Modified and ETag, applications are cached in consultation strategy. The main difference between the strength of the cache is whether it will send a request to obtain resources.

Access to resources under the main browser There are seven:

(New tab) Enter the address bar

Jump Links

forward, backward

Open links from favorites bar

(Window.open) opened a new window

Refresh (Command + R / F5)

Forced refresh (Command + Shift + R / Ctrl + F5)

When you use these 7 ways to access resources, application caching strategies have some differences. Note that, in addition, there is a special case. That is the current address bar does not change the content, direct the transport, equivalent to refresh the current page. But in the current page click to jump to itself, and links to jump the same, and will not be equivalent to refresh.

If you want to learn Web front-end technology, we must understand more about the market. If you do not have any foundation, you can choose a professional professional, in-depth study good school, in order to more objectively understand the nature of them.


Guess you like

Origin blog.51cto.com/14551723/2442647