Link prefetching principle and performance test, linkprefetching

Source: Internet
Author: User
Tags prefetch

Link prefetching principle and performance test, linkprefetching
Background: Link Prefetching is a standard of HTML 5. It was first published by Mozilla as an Internet standard draft. link prefetching is now part of W3C and WHATWG about HTML 5. The webpage can be embedded with the prefetching tag. When the browser finishes loading the current page, it ends loading the webpage. When the browser is idle, The prefetching tag link will be triggered, and the browser will silently prefeching the specified documents in the background, and stored in the cache. When a user accesses prefetched documents, the content in the cache is quickly used to accelerate web page display. Syntax for triggering Prefetch:

<link rel="prefetch" href="http://www.cmcm.com"> prefetch cmcm </link>

HTTP link Syntax:
Link: </images/big.jpeg>; rel=prefetch

HTML meta tag: the specific format is defined in RFC 5988 Section 5.
<meta http-equiv="Link" content="</images/big.jpeg>; rel=prefetch">

Browser Prefetching & Web Developer Prefetching timing: As mentioned earlier, the browser performs prefetching at idle time. Firefox uses the nsIWebProgressListener API in Mosilla1.2, And we can register the top-layer nsIWebProgress object, through this, we can receive the document start & stop notification. We can take the document that was last stopped and the myopia idle value of the next document start as the interval. when onLoad triggers processing top-level documents, the last document stop notification is triggered. This is the time for us to start prefetch requests. If a subframe contains the prefetching tag, the browser prefetching will not start immediately but will not be triggered until the top-most frame and all its sub-frames are loaded. Whether prefetching is suitable for your site depends on yourself. the following are several suggestions: (1 ). when the pages of some columns are only slideshow, load the first and second pages (provided that these pages are not big pages) (2 ). pre-load most images from the beginning to the end of the entire website (3 ). prefetching the search result page of your website
Next, let's take a look at our confusing scenarios: 1. How do users do this when they click a link browser that is being Prefetching? When you click or initialize page loading, link prefetching stops and all prefetch operations are discarded. If the prefetch document has been downloaded, the document will be stored in the cache and provided to the server with an "Accept-Ranges: bytes" header for use. This request header is generated by webservers when the static content is triggered. When you access a prefetched document in real time, the reserved part of the document will be extracted using the HTTP byte-range request. 2. will link prefetching grab bandwidth when users download data in the background? Yes and no. If you use the Mozilla Browser to download, link prefetching will be delayed until all the downloads are completed in the background. For example, if you open several tabs to load webpages that contain the prefetching tag, Mozilla will remember the prefetch request only after all tabs are loaded. When you use its own application to use bandwidth, prefetch will compete with other applications. This is a problem that the browser will need to be improved. Here, our browser will also make corresponding improvements, such as prefetch when the network is idle.
Prefetch restrictions and switches: 1. prefetch can be used only for http and https, and prefetch is not supported for ftp. 2. Only html link tags support prefetch, and other tags such as <a> </a> are not supported. 3. You can disable prefetch through js Code
user_pref("network.prefetch", false);
However, the problem is that although this option is currently provided, most browsers have problems with this option. In other words, even if this option is enabled, prefetching may also occur. 4. Test whether your browser supports prefetching Test Prefetching
Link Prefetching performance test environment: Xiaomi 2: CM BrowserAndroid 4.1.1 System
Site/page load time Enable Prefetching None prefetching Improve (%)
Www.cmcm.com 6367 9470 35%
Www.taobao.com 871 1112 13%

08-03 17:18:41.299: E/Timer(20970): pageStarted   http://www.cmcm.com/08-03 17:18:41.399: E/Timer(20970): pageFinished  http://www.cmcm.com/08-03 17:18:41.419: E/Timer(20970): pageStarted   http://www.cmcm.com/en-us/08-03 17:18:47.675: E/Timer(20970): pageFinished  http://www.cmcm.com/en-us/636708-03 17:20:07.631: E/Timer(21417): pageStarted   http://www.cmcm.com/08-03 17:20:08.862: E/Timer(21417): pageFinished  http://www.cmcm.com/08-03 17:20:08.882: E/Timer(21417): pageStarted   http://www.cmcm.com/en-us/08-03 17:20:17.371: E/Timer(21417): pageFinished  http://www.cmcm.com/en-us/9740-----------------------------------------------------------------------------------------------08-03 20:57:55.765: E/Timer(26875): pageStarted   http://www.taobao.com/08-03 20:57:55.805: E/Timer(26875): pageStarted   http://m.taobao.com/?sprefer=sypc0008-03 20:57:56.877: E/Timer(26875): pageFinished  http://m.taobao.com/?sprefer=sypc00111208-03 21:00:45.817: E/Timer(27666): pageStarted   http://www.taobao.com/08-03 21:00:45.867: E/Timer(27666): pageStarted   http://m.taobao.com/?sprefer=sypc0008-03 21:00:46.688: E/Timer(27666): pageFinished  http://m.taobao.com/?sprefer=sypc00871

Enabling prefetching through our own browser testing can significantly increase the page loading speed.
Reprinted. Please describe the source. Thank you! Welcome to join us. Http://blog.csdn.net/typename/article/details/38358765 powered by miechal zhao.





How much can be tested-the principle and architecture of the tool can be tested

However, performance tests are not loadrunner, so do all authors. But when talking about performance testing, they are talking about loadrunner, but how much is the difference. Do you think I hate loadrunner? I want to learn it separately, but I hope that I will not be limited by loadrunner when learning performance tests. I just think that I don't think about loadrunner when performing performance tests, so that I can easily grasp the essence of performance tests. ------------------------------------------------- Performance testing tool. In a broad sense, all tools used in the performance testing process can be called as performance testing tools. In a narrow sense, we can divide performance testing tools into server-side performance testing tools and performance testing tools earlier. Server-side performance testing tools are also what our testers generally consider as performance testing tools. LoadRunner, JMeter, SilkPerformance, and server-side Stress Performance Tools must support generating pressure and load, recording and generating scripts, setting and deploying scenarios, and generating concurrent users and putting continuous pressure on the system. Front-end performance testing tools are widely used by developers, front-end developers, and testers. Firebug, fildder2, Yslow, and front-end performance testing tools only need client tools such as the browser to process the pages to be displayed. Principle of server performance testing tool the main function of a performance testing tool is to simulate real business operations in the production environment and perform stress load testing on the tested system, monitor the performance of the tested system under different services and different pressure, and identify potential performance bottlenecks for analysis and optimization. The client and server communicate with each other through information. Due to the embarrassment of direct communication during the first meeting, the client sent the information to the contact and sent it to the server. Then, the server's feedback is also forwarded to the client by the transmitter. Generally, performance testing tools require recording or compiling client behavior scripts. In this way, the passer has the client's ability to act and impersonate the client to cheat the server and communicate with it. With the client behavior, data transfer personnel can perform self-replication. In this way, more than N data transfer personnel can communicate with the server. --- The behavior and ability of this pass-through tool are also the basic characteristics of the performance testing tool. (The performance tool suddenly seems like a third party, and it is a third party that can replicate itself crazy and abnormal, haha !) For popular performance testing tools, their basic working principles are consistent. Simulate virtual user access on the client through multiple threads or multi-process, apply pressure on the server, and then monitor and collect performance data during the process. What are the characteristics of performance testing tools? 1. The tool itself occupies less system resources, provides good scalability and high availability. 2. It can simulate real business transaction operations and generate real business pressure during concurrency. (This is the core) 3. Perform a good performance analysis on the stress test results to quickly identify the bottlenecks of the tested system. 4. The test script is highly repetitive. Why am I so confused about the architecture user behavior generation part of the server performance testing tool? For friends familiar with loadrunner, I am a virtual user script generator, which is easier to understand, we can either record or write it manually. Do not think this is the only way to generate user behavior. Because various components are added to JMeter to complete user behavior through component configuration, you can also use recording. Curl_loader, a relatively simple performance testing tool, describes user behavior in the form of a configuration file. I have mentioned earlier that although performance testing tools are described in different forms, their principles are the same and are implemented through Proxy. Specifically, proxy acts as the intermediary between the client and the server to receive data packets from the client. The pressure generator is used to generate actual loads based on the script content. In the performance testing tool, the pressure generator plays the role of "generating load. The root user's settings are also used to perform self-replication to generate multiple clients to the server... the remaining full text>

Principle of comprehensive Tester for Electronic Industry six-in-One Security

This type of instrument integrates the safety and regulation parameters for testing, but many interfaces are separated and there is no way to achieve them together. It also requires separate wiring, pressure resistance and insulation, leakage and startup can be tested together, and grounding should be separated. Therefore, such an instrument is suitable for testing in the quality department or laboratory, and is not suitable in the production line, but it is troublesome ....

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.