Minified assets and gzip
-
Hello there,
Great plugin. Thanks for the work.
I use nginx and fastcgi_cache for the wordpress websites I host. For some sites I can install W3TC, for some I cannot, so for me the best way to go in overall cache is do it on nginx side. All requests to dynamic pages are cached to tmpfs and purged when purge is needed. All good.
I also use gzip_static to serve pre-gzipped assets like js, css… this makes it possible to use highest compression level (9) without the cpu overhead of on-the-fly compression, which I cannot afford on my servers.I’ll use W3TC for minify and CDN.
CDN seems to work fine. My questions are regarding minify.
W3TC seems to combine and minify my assets just fine, generating the correct link.
I did some SIEGE with these parameters:
Siege benchmark mode with 20 concurrent users for 120 seconds on Amazon Ec2. Target machine is m1.small, siege machine is cpu heavy.
Siege hits only the root page of one blog and ALL ITS ASSETS as extracted from html. All .js, .css, .img etc. Combined or not, minified or not, depending on the scenario I am testing. This is how I test. It simulates a full user load on the starter page with empty cache.First scenario is nginx + fastcgi_cache + gzip_STATIC. No w3tc. No minified assets.
I got a throughput of 20mb/s, response time of 0.01secs.
That is fast enough. Almost the ec1 m1.small network out cap, which is 35mb/s. Everything is hitting cache or served as static and the only gzipping being done on-the-fly is on the dynamic page – all other assets are pre-gzipped.Second scenario is nginx + fastcgi_cache + gzip_STATIC (no point really, anyway) + W3TC with Minify on.
Throughput was 8.49 MB/sec and response time was 0.11secs.
All assets are minified and combined. Cache is being hit everytime. No php is being hit during the tests – that means nginx is serving the combined .js and .css static without passing through php5-fpm. All good.I believe the difference in results can only be because W3TC minified assets have to be gzipped on every hit and that makes a huge difference in cpu usage and in throughput.
My question is: Is it possible to make W3tc save a .gz version of minified assets? Nginx will make sure that gets served instead of gzipped on the fly if you use gzip_static. That would save some cpu.
Best regards.
The topic ‘Minified assets and gzip’ is closed to new replies.