Skip to main content
Recipes

Scanning Large Sites

Bound the scan or select representative routes before auditing a large site.

Set a route limit

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  site: 'https://example.com',
  scanner: { maxRoutes: 100, exclude: ['/admin/*', '/api/*'] },
})

Select representative routes

import { defineUnlighthouseConfig } from 'unlighthouse/config'

export default defineUnlighthouseConfig({
  site: 'https://example.com',
  urls: ['/', '/blog/example', '/products/example'],
})

Explicit URLs stop link following. Legacy dynamic sampling and custom sampling do not control the v1 scan pipeline.

Name route templates

Use Route Definitions to match concrete URLs to framework page templates. Templates do not replace the concrete URLs needed for dynamic pages.

Keep performance measurements reliable

Use scanner.perfConcurrency: 'serial' when comparing performance scores. Increase scanner.samples when you need repeated audits, within the supported limit of 10. See Improving Accuracy.

Did this page help you?
Anything that could be done better? :)
Help us improve this page. You can edit this page on GitHub or provide anonymous feedback below.