Optimization & Assets
Leaner HTML, real CSS/JS files, and why your logged-in preview still looks “normal.”
Optimization runs when HTML is written, not when a logged-in editor views live WordPress. After you toggle options, Full Rebuild (or process the queue) so existing files catch up.
If you compare the admin preview with a private window and they look slightly different (tighter HTML, lazy images), that is success, not a theme bug.
CDN-friendly files
Keep stylesheets & scripts as external files (on by default) so ImageKit, CloudFront, or similar can rewrite real file URLs instead of giant inlined blobs. CDNs cannot cache a novel pasted inside the HTML very well.
External CSS and JavaScript
When Keep stylesheets & scripts as external files is on:
- Generation requests tell WordPress not to inline stylesheets and to
load block CSS as files under
wp-includes/wp-content. - Leftover inline
<style>/<script>bodies are written towp-content/tivlo-static/assets/{css|js}/. - Those bodies are replaced with
<link>/<script src>tags.
That keeps HTML lean and lets a CDN cache the actual assets.
Consolidate CSS
Consolidate duplicate stylesheets globally (on by default) merges theme, block, and global styles into one cached file:
wp-content/tivlo-static/assets/css/bundle-*.cssFewer render-blocking requests per page. Rebuild after changing this toggle.
HTML Compactor
Master switch: Optimize exported HTML for performance. Sub-options:
| Option | Default | What it does |
|---|---|---|
| Minify HTML Core | On | Collapse whitespace, strip HTML comments |
| Lazy-Load Inline Media | On | loading="lazy" on images; the first stays eager with fetchpriority="high" so the hero is not fashionably late |
| Strip WP Bloat Scripts | On | Emoji scripts, oEmbed/REST discovery, shortlinks, obsolete type attributes |
| Preload Asset Hints | On | dns-prefetch / preconnect for third-party hosts |
Inject Tivlo Generator Metadata (separate from the compactor) embeds a diagnostic HTML comment with a build timestamp. Handy when you are staring at two identical-looking pages asking which one is new.
Change the toggles under Optimization & Performance on Plugin Settings.
Click Save Settings.
Build Console → Full Rebuild.
Logged-in preview is uncompressed
Live WordPress for logged-in users is unchanged. Compare exported files or a logged-out window. Do not judge minification from the admin bar.
add_filter( 'tivlo_ssg_optimized_html', function ( $html, $url ) {
return $html;
}, 10, 2 );How is this guide?