Performance tips:
- Use assets compression:
- Apply efficient cache policy:
- Cache immutable assets for a long time (1 year or longer)
- Embed hashes to the asset's filenames to allow updates
- Support back/forward cache (
cache-control:no-store
cannot enter back/forward cache)
- Inline critical CSS and lazy-load the rest:
- Lazy load non-critical resources:
- Defer offscreen images and iframes using
loading="lazy"
attribute - Split javascript using dynamic
import()
- Defer offscreen images and iframes using
- Serve images in modern formats:
- Pre-render pages for instant navigation:
- Speculation Rules API
- Static Site Generation
- Service Worker (Workbox)
- Consider applying SSR or SSG (pre-rendering):
- Angular Universal for Angular
- Gatsby for React
- Investigate new web features:
yarn install --frozen-lockfile