Vue optimization
- Vue-router lazy loading: Vue asynchronous components, Webpack require.ensure(), ES6 import,
- Load the UI library on demand
- If the first screen is a login page, multiple entries can be made
- The page uses the Skeleton Screen
- Server side rendering SSR (generating HTML strings from components or pages through the server, sending them to the browser, and finally “blending” static markup into a fully interactive application on the client side)
Network optimization
- Reduce the number of HTTP requests
- Take advantage of the browser cache and reduce
cookie
Size, use as much as you canlocalStorage
Instead of - CDN acceleration, hosting static files
- Enable Gzip compression: Enable Gzip compression for Nginx cache and Webpack
Js optimization
- Throttling and anti-shaking
- Dynamic loading, paging loading (big data rendering)
- Image lazy loading (data-src) reduces network bandwidth
- When using closures, manually remove unwanted local variables at the end of the function, especially if dom nodes are cached
- Async parses the DOM tree and loads js at the same time. After loading, suspend parsing the execution JS. Defer parses the DOM tree and loads js at the same time, and executes JS after parsing
CSS optimization
Do not use CSS expressions
Reduced backflow (rearrangement)
Avoid deep nesting of CSS files
SEO optimization
Highlight important content – reasonable design of title, description and keywords
Write HTML code semantically, conforming to W3C standards
Add Alt and title attributes to the image img tag
Add the title attribute to the link in-page tag
The H1 tag has its own weight