CSS Minification

#1

We have our Cloudflare account set to Auto Minify CSS. However, many of our CSS files are not getting minified. Blank lines, white space, comments, etc are all still visible in the file.

I have even created a page rule for minifying these files, and getting the same result.

I have tried clearing the cache for these files, even clearing my cache, and they are not being minified.

The files have a .css file extension and are being served with the correct mime type from the server.

I have been reading some of the posts about minification and see Cloudflare may not optimize them as good as possible, but I am expecting something more than this…

1 Like

#2

Can you post a link to such a CSS file?

0 Likes

#3

Are those files getting any type of minification? It could just be a parsing error if they’re not compliant.

1 Like

#4

Our custom theme file appears to minify after a few minutes…
https://homefurn.com/Themes/Brooklyn/Content/css/theme.custom-1.css

Other theme files do not, ex:
https://homefurn.com/Themes/Brooklyn/Content/CSS/1280.css

0 Likes

#5

image

As to why -> @cloonan maybe

1 Like

#6

Its not quite clear to me why Cloudflare cant minify it. It does not seem to be the file itself, as I do get the file minified when served over a different domain.

On the other hand however it does not seem to be specific to the OP’s domain either as the other CSS file does get minified and there is no major difference in response headers. I briefly suspected the uppercase CSS could influence it, but https://homefurn.com/Themes/Brooklyn/Content/css/1280.css does not get minified either.

@cscharff?

1 Like

#7

For a bit I only received a miss for both the files, indicating it’s not cached so not minified; 1280.css was a miss consistently but now is a hit. More digging to do.

1 Like

#8

So the files are not caching at Cloudflare?

Could there be a problem with the headers being sent from the origin server?

0 Likes

#9

The file does appear to be cached by Cloudflare, however it seems they cant minify it for some other unknown reason.

0 Likes

#10

Curious to see if maybe there was an error in the CSS in that file, I ran the CSS through the linter at http://csslint.net and only received a few warnings but no errors… hmm

0 Likes

#11

As I mentioned, I got the same file minified by Cloudflare over a different domain.

You will probably have to wait until @cloonan has finished digging :slight_smile:

0 Likes

#12

Hi @jphifer, I’m not turning up much of anything, different validators give different warnings, but no errors. One gave one warning, another over 20, which is when I suspected the large number of warnings was causing a parsing that @sdayman mentioned. But, as @sandro pointed out, it works on other domains.

I’d like to get other eyes on this for input. Can you login to Cloudflare and then open a ticket with Cloudflare Support. Support is very busy at the moment and it will take them some time, but it’s worth having them look at it. If you can, share the ticket number and I’ll get it into the right queue.

0 Likes

closed #13

This topic was automatically closed after 30 days. New replies are no longer allowed.

0 Likes