cwv_optimize_html
Optimize HTML to boost Core Web Vitals by automating image dimensions, font preconnects, script deferral, and lazy loading.
Instructions
Transform and optimize HTML code with automated image dimensions, font preconnects, script deferral, and lazy loading to boost CWV scores.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | Raw HTML string to optimize. | |
| file_path | No | Path to local HTML file to read and optimize (used if html string is omitted). | |
| defer_scripts | No | Whether to add 'defer' to render-blocking head scripts. | |
| lazy_load_images | No | Whether to add loading='lazy' and decoding='async' to images. | |
| preconnect_fonts | No | Whether to inject font preconnect headers. | |
| inline_critical_css | No | Whether to inline critical CSS. |