Prompt
How do I prepare assets for faster page speed?
Latest observation
Nov 2, 2026
OpenAI APIWeb search: off
To prepare assets for faster page speed, focus on reducing file size, number of requests, and render-blocking behavior. Here’s a practical checklist:
1) Optimize images
- Resize images to the exact display size — don’t serve a 3000px image if it displays at 600px.
- Use the right format:
- AVIF/WebP for most photos and complex images
- SVG for logos/icons/illustrations
- PNG only when you need transparency and lossless quality
- JPEG for compatible photo fallbacks
- Compress images before upload.
- Use responsive images with
srcset/sizesso browsers download the best size. - Lazy-load images below the fold.
- Set explicit
widthandheightto prevent layout shifts. - Serve images via a CDN when possible.
2) Minify and bundle CSS/JS
- Minify CSS, JavaScript, and HTML.
- Remove unused CSS/JS.
- Split code so only the needed assets load on each page.
- Avoid large libraries if you only use a small part of them.
- Load non-critical JS with
deferorasyncwhen appropriate.
3) Reduce render-blocking assets
- Inline only the most critical CSS needed for above-the-fold content.
- Delay nonessential CSS/JS.
- Preload key assets like hero images, important fonts, or critical CSS.
4) Optimize fonts
- Use modern font formats like WOFF2.
- Subset fonts to include only needed characters/weights.
- Limit the number of font families and weights.
- Use
font-display: swapto avoid invisible text. - Consider using system fonts for best speed.
5) Compress and cache
- Enable Brotli or Gzip compression on text assets.
- Set long-lived browser caching for static assets with versioned filenames.
- Use cache headers and immutable asset naming where possible.
6) Use fewer third-party assets
- Audit analytics, chat widgets, ads, and trackers.
- Remove anything unnecessary.
- Load third-party scripts only when needed and after the main content.
7) Deliver assets efficiently
- Use a CDN.
- Serve HTTP/2 or HTTP/3 if available.
- Keep assets close to users geographically.
- Prefer fewer, smaller files over many large ones where it makes sense.
8) Measure before and after
Use tools like:
- Lighthouse
- PageSpeed Insights
- WebPageTest
- Browser DevTools Network tab
Check:
- Largest Contentful Paint (LCP)
- Cumulative Layout Shift (CLS)
- Total Blocking Time (TBT)
- Total asset weight and request count
If you want, I can also give you:
- a step-by-step asset optimization workflow, or
- a checklist for images, CSS, JS, and fonts separately.