In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the "HTML5 how to preload so that the page can be presented quickly", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "HTML5 how to preload so that the page can be rendered quickly" bar!
Preloading is a browser mechanism that uses browser idle time to pre-download / load pages / resources that users are likely to visit next. The page is provided to the collection that the browser needs to preload. After the browser has finished loading the current page, the page that needs to be preloaded will be downloaded in the background and added to the cache. When a user visits a preloaded link, the page renders quickly if it is hit from the cache.
Brief overview: based on user analysis, the website allows the browser to download the specified page / document / image at the backend to achieve super easy:
HTML5 preload label
The code is as follows:
As you can see from the HTML code above, preloading uses the tag and specifies the rel= "prefetch" attribute, and the href attribute is the file path that needs to be preloaded. Mozilla also implements some similar link rel attributes:
The code is as follows:
Note: the https protocol is also supported.
When preloading is needed
Whether the site uses preloading or not depends on your needs, here are some suggestions:
-if a series of page slides are shown, you can preload 1 to 3 pages each.
-load images commonly used within the site
-preload the next page on the search results page
Block preloading
Firefox allows preloading mode to be disabled as follows:
The code is as follows:
User_pref ("network.prefetch-next", false)
Matters needing attention
With regard to link preloading, there are the following considerations:
-preloading can be performed across domains. Of course, information such as cookie will also be sent when a request is made.
-preloading may destroy website statistics, but users do not actually visit them.
-Mozilla Firefox is currently the only browser that supports preload mode, (2003-2010)
Thank you for your reading, the above is the content of "how to preload the HTML5 so that the page can be presented quickly". After the study of this article, I believe you have a deeper understanding of how to preload the HTML5 so that the page can be presented quickly, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.