Flatten CSS imports

PageSpeed Optimization Filters


Avoid unnecessary server roundtrips by applying a PageSpeed recommendation.

flatten_css_imports parses linked and inlined CSS and flattens it by replacing all @import rules with the contents of the imported file, repeating the process recursively for each imported file. It works on CSS found in style blocks and link references.


Enable pagespeed EnableFilters flatten_css_imports
Enabled by default via RewriteLevel CoreFilters
Disable pagespeed DisableFilters flatten_css_imports


Setting pagespeed CssFlattenMaxBytes [bytes]
This is the maximum size in bytes of the flattened CSS; if flattening would result in CSS larger than this then flattening will be aborted and the CSS will be left unchanged.

Risk Classification



soon available