MIP acceleration principle
This document explains in detail the acceleration principle of MIP pages for you
Carefully designed JavaScript
In order to remove bloated client scripts, MIP files do not allow custom JavaScript; For some functions that strongly rely on JavaScript (such as advertising, statistics, and interaction), MIP provides encapsulated components compatible with the MIP runtime for implementation.
JavaScript citation principle:
Currently, MIP does not allow users to customize JavaScript, and it needs to be introduced in the form of MIP components to ensure security and performance
You can refer to mip-iframe to introduce some rich interaction functions. In this way, even if you use document.write, which affects the most performance during development, it will not affect the rendering of the main page
MIP components are open source, allowing developers to customize functional components, and the project will continue to provide a variety of components to adapt to different needs
All static resources Dimensions need to be specified
During page development, resources often do not have width and height set, especially when using ads or injecting by calling `document.write(). Since the resource size cannot be determined, the page often needs to be redrawn repeatedly;
Now, MIP requires that all resources (advertising, pictures, audio and video) be marked with size. When the resources are actually loaded, all resource sizes can be inferred immediately and quickly used to calculate the page layout. The loading resources will be seamlessly presented without affecting the user's reading experience due to frequent page layout updates.
No mechanism is allowed to prevent page rendering
Any custom scripts by developers need to be fed back to MIP using MIP tags, such as mip-ad, mip-iframe, etc. These methods do not Will block the layout and rendering of the page.
Control the loading of external resources
MIP runtime will control the loading of external resources to ensure its efficiency, so that the content the user wants to read appears on the screen as soon as possible.
Encapsulating interactive functions
MIP advocates that web pages can give users a direct and simple experience, but this does not mean that MIP limits the liveliness and interest of the page. MIP runtime provides highly optimized encapsulated JavaScript, so developers do not need to invest too much effort in implementing complex interactive functions.
Only allow inline css
The loading of css will prevent the rendering of the page. Inline css can reduce client overhead.
Only GPU-accelerated animations are allowed
MIP only allows transformations and opacity to be used to complete animation effects. When the animation can be executed on the GPU, only rendering layer merging is triggered.
MIP Cache
Another important significance of MIP is that it can help webmasters speed up web pages. Baidu will cache MIP web pages into Baidu CDN. MIP caching can be used as long as it complies with the MIP standard.
Open and continuously updated
MIP is an open source project, and all standards are not static. We will continue to optimize and look forward to your participation!