filter · CSS filters
Compute critical CSS (compute_critical_css)
- Category:
- CSS
- CoreFilters:
- No
- OptimizeForBandwidth:
- No
- Risk:
- Not rated
Not a core filter; experimental. Computes a page’s critical CSS on the server in the background, instead of from the browser reports that prioritize_critical_css uses. It is the module’s older, beacon-free path and is not tuned for production: use prioritize_critical_css unless you are specifically testing this one.
How it works
Enabling it adds server-side CSS analysis for every page it sees. There is no example in the gallery.
When to use it
- Not in CoreFilters: it runs only when you enable it by name.
Risks
The
CSS filters
page lists no specific risks for this filter.
If a page misbehaves with it, DisableFilters compute_critical_css turns it off for
the scope you set it in.
Configuration
Enable it in the module configuration, at server, virtual-host or location scope:
Apache
ModPagespeedEnableFilters compute_critical_cssnginx
pagespeed EnableFilters compute_critical_css;IIS (pagespeed.config)
pagespeed EnableFilters compute_critical_css
Scoping, ForbidFilters and the thresholds filters read:
Choosing filters
.
Frequently asked questions
- What does the compute_critical_css filter do?
- Not a core filter; experimental. Computes a page's critical CSS on the server in the background, instead of from the browser reports that
prioritize_critical_cssuses. It is the module's older, beacon-free path and is not tuned for production: useprioritize_critical_cssunless you are specifically testing this one. - Is compute_critical_css enabled by default?
- No.
compute_critical_cssis not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable compute_critical_css on Apache and nginx?
- Add
ModPagespeedEnableFilters compute_critical_csson Apache orpagespeed EnableFilters compute_critical_css;on nginx. On IIS, addpagespeed EnableFilters compute_critical_cssto pagespeed.config.
Related filters
- combine_css — Combine CSS
- extend_cache_css — Extend cache for CSS
- fallback_rewrite_css_urls — Fallback CSS URL rewriting
- flatten_css_imports — Flatten CSS @imports
- inline_css — Inline CSS
- inline_google_font_css — Inline Google Fonts CSS
- inline_import_to_link — Convert @import to link
- move_css_above_scripts — Move CSS above scripts
This page is drawn from the compute_critical_css entry on CSS filters. Every filter in one table: PageSpeed filters.