Search
+1 (617) 7782998 | info@iispeed.com

Flatten CSS imports

Benefits

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.

Description

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.

Configuration

For PageSpeed on IIS and PageSpeed on ATS

Enable
pagespeed EnableFilters flatten_css_imports

Enabled by default via RewriteLevel CoreFilters

Disable
pagespeed DisableFilters flatten_css_imports

Risk Classification

Moderate

Examples that demonstrate optimization in real time are available here.

core
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