+1 (617) 7782998 |

Flatten CSS imports


Avoid unnecessary server roundtrips by applying a PageSpeed recommendation.

Tuning the optimization

This filter listens to the following 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.


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.


For PageSpeed on IIS and PageSpeed on ATS

pagespeed EnableFilters flatten_css_imports

Enabled by default via RewriteLevel CoreFilters

pagespeed DisableFilters flatten_css_imports

Risk Classification


Examples that demonstrate optimization in real time are available here.

PageSpeed optimization, powered by the official Google PageSpeed SDK

Share View Comments
Some content on this website represents a modified version of the official Google PageSpeed documentation