Skip to main content

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_css

nginx

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_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.
Is compute_critical_css enabled by default?
No. compute_critical_css is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable compute_critical_css on Apache and nginx?
Add ModPagespeedEnableFilters compute_critical_css on Apache or pagespeed EnableFilters compute_critical_css; on nginx. On IIS, add pagespeed EnableFilters compute_critical_css to pagespeed.config.

This page is drawn from the compute_critical_css entry on CSS filters. Every filter in one table: PageSpeed filters.

Search