Cloudflare minification is terrible


#1

Take this minified file https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js and check it’s size. It’s around 85KB.

Now get the unminified version at https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js which is around 250KB.

Now take the unminified version and put in your webserver that uses Cloudflare. Enable CSS/JS/HTML MINIFICATION. Now try to access the file on your browser.

I did exacty that. Indeed, Cloudflare IS MINIFYING the file HOWEVER the final size is 140KB! Is terribly minified, it’s almost twice the size of the already minified file provided by Jquery library.

What is going on? Why does cloudflare minification is so terrible?


#2

I guess when cf says minification they mean only remove white space and some new lines, while cdnjs actually taking another step and uglify the code to make it smaller(changing variable names and other tricks)

I understand cloudflare as when you entering into uglify you can end up with some bug and errors and some rare edge cases they probably cant count on it in their scale…

but the real answer is: don’t count on cloudflare for js minification… just minify it yourself


#3

That’s what I guessed… cloudflare minification is terrible, it is only removing newlines, spaces and a few comments (not all comments are removed).