Minify using Cloudflare vs plugin

wordpress

#1

Hi, i’m using wordpress, and using w3 total cache. I know if i enable minify on plugin i has to disable it on cloudflare and vice versa. So i would like to know where it is better to enable and why.


#2

You might get better performance using Cloudflare minify since the minify would happen on Cloudflare, removing the plugin processing time from your server.

If a plugin runs your server has to compute the minified version, and depending on how good the plugin functions, the minificatin might add 100+ milliseconds to the page load times. Cloudflare minification is ran on very powerful servers and adds a unnoticeable amount of milliseconds to response time.

However, you should test both solutions yourself and see if one or the other changes how fast pages load. You could also measure how much data is sent with each one in chrome/ff dev tools -> network tab

image


#3

Testing is the only way to know for sure. CF’s minification is not super dense but instead prefers to play it safe. It does not removed line breaks, and sometimes not the leading characters either.

Compare (view source)…

https://gravitywebworks.com/?nominify
This uses only Cloudflare’s minify. As you can see it has line breaks and even leading characters. It takes about 200ms to load the html.

https://gravitywebworks.com/
This uses my own minify code. It’s CSS and JS safe, but produces only one line of code. It loads in about 60ms.

So you see there is more to minification than just processing power. I’m pretty sure my entry level VPS is less powerful than CF’s servers!

Try both ways. And let us know what you find out. Remember to disable cache in your browser and also at CloudFlare.


My Questions About Wordpress and Cloudflare
#4

this difference is too crazy, for me its
1.3s vs 384ms

I think something else is effecting this test… maybe the url parameter prevent some caching from happen?

looking at the non parameter url I see that " CF-Cache-Status:hit" header while its not preserved in the other url


#5

But CF-cache is not activated in the first page.


#6

I did have Cache Everything enabled. But I turned it off just now. You’re welcome to run more comparisons. After today I’m going to set caching html back on.

https://gravitywebworks.com/?nominify
CF-only minification shows me between 60ms and 150ms.

https://gravitywebworks.com/
ColdFusion minifications shows me 65ms to 80ms.


#7

Thank you so much sir. That’s really perfect! :slight_smile:
Hope any HTML minification won’t affect Adsense and Analytics codes badly.

Best regards.


#8

Cloudflare’s minification is safe because it does not remove line breaks. If you want to minify more, you have to take special care with inline scripts - mostly because of the line comments such as // these.


#9

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