Optimization in Thulite is mostly about shipping less code and doing less work on first load.

Build for production

Use a production build with garbage collection and minification (hugo build --gc --minify):

This removes unused build artifacts and compresses generated output.

Keep CSS lean

Thulite uses PostCSS and can remove unused selectors in production (via hugo_stats.json + PurgeCSS). Keep your safelist current for dynamic classes.

Ship optimized assets

Thulite Core compiles and fingerprints CSS/JS bundles. This gives:

  • Smaller assets in production
  • Stable integrity hashes
  • Efficient browser caching with automatic cache busting on content change

Defer non-critical work

Thulite Core supports async script loading, link prefetching using Quicklink, and native image lazy loading. These reduce main-thread and network pressure during initial render.

Verify with real checks

After each change, run a production build and validate:

  • Lighthouse / PageSpeed scores
  • JavaScript and CSS payload size
  • No regressions in Core Web Vitals

Learn more

Hugo
hugo build

Command reference for production builds with minification and cleanup flags.

Hugo
resources.Minify

Minify CSS, JavaScript, JSON, HTML, and SVG resources in Hugo pipelines.

PurgeCSS
PurgeCSS

Remove unused CSS selectors from production bundles.

Quicklink

Prefetch in-viewport links during idle time to speed up navigation.