DreamPress, Minifying, Varnish, and W3 Total Cache

wordpress

#1

Hi.

Like many on these boards, I’ve been trying hard to find ways to break through the less-than-ideal response/load times DreamPress is delivering… after all, we’re paying a substantial additional monthly fee. I think the overall consensus is that people are expecting a bit more for their $$$.

That being said, running the various page speed diagnostics (Chrome’s Audit Tool, YSlow, Google PageSpeed Insights) there are a few things that I wanted to get some advice on to aid me in optimizing my page.

A: Minifying
I’ll concede that the themes and plugins are the main culprit behind the great multitude of http requests. For this reason, I’m interested in employing some sort of CSS, JS, HTML Minifier plugin… and that lead me to W3 Total Cache, which opened a pandora’s box of tweaking options I had no idea about.

Question 1: Why does DreamHost not recommend using W3 Total Cache with a DreamPress deploy/Varnish? I see plenty of articles claiming they can work together fine and it is even mentioned in a DH wiki post Fine Tuning Your WordPress Install. In fact, the first article that returns negative search results for conflicts is a DreamPress issue which is a this board. DreamPress Varnish caching conflict with plug-ins

Question 2: Does Dreamhost recommend any minifying tools? W3TC recommend Tidy, which doesn’t seem to be installed on the DP server. I checked the wiki and don’t think this is something I have rights to do Tidy

B: Server Optimization
Using the W3TC Plugin’s install guide, there seem to be a few tweaks they recommend that DreamPress doesn’t address:
[list]
[].htaccess optimizations
[
]PHP installs like PECL
[/list]

Question 3: Are the tweaks suggested by W3TC only valuable if using memcache(d)? Can .htaccess optimization be baked into DreamPress?

Question 4: Besides simplifying, removing themes, plugins, etc, does DH recommend any other advanced tweaking that can improve the response times from my DreamPress install? Is getting a dedicated server the most powerful way to speed things up?

Thanks for your help!
Curtis Anderson www.steamericas.com


#2

Because W3TC is insanely complex. We opted to use the Varnish HTTP Purge plugin and the Memcached Redux because it’s simple, fast, effective, and there’s no configuration needed (99% of the time - and we take care of cloudflare for you). In part, my feeling was that if someone WANTS to use it, but most people just want something that works out of the box. W3TC is awesome, but it’s a lot of hands on tweaking and testing per site to make it work best.

We provide Pagespeed, which can do that. There is some latency with all minification, but in general if you’re using Varnish (on DreamPress) then you really DON’T need to worry about minifying, since the load is cached on the Varnish server instead of Apache.

If you do want to use Pagespeed on DreamPress, read this: http://wiki.dreamhost.com/DreamPress#Can_I_use_PageSpeed_and_Varnish_together.3F

[quote]
Question 3: Are the tweaks suggested by W3TC only valuable if using memcache(d)? Can .htaccess optimization be baked into DreamPress?[/quote]

Nope! But… The reason we don’t use W3TC is also that it’s different for everyone, so it’s optimizations are going to be either unneeded (you don’t need static file cache because of Varnish, and Memcached Redux does what W3TC does for Memcached anyway), or totally unique to your situation. Since that’s impossible to automate, we opted not to.

Figure out WHY it’s slow. I like to check a site real fast at http://www.isvarnishworking.com/ to see if Varnish is able to cache. if it’s NOT then I know why my site’s so darn slow!

Also we’ve been seeing some insane improvements on PHP 5.4, and we’re totally happy to help you by bumping your PHP memory on DreamPress (which I actually just did for you)

Another thing to try is optimizing your database. WP is usually very good about it, but the same can’t be said of all plugins and themes.


#3

[quote=“Ipstenu-DH, post:2, topic:61734”]Figure out WHY it’s slow. I like to check a site real fast at http://www.isvarnishworking.com/ to see if Varnish is able to cache. if it’s NOT then I know why my site’s so darn slow!

Also we’ve been seeing some insane improvements on PHP 5.4, and we’re totally happy to help you by bumping your PHP memory on DreamPress (which I actually just did for you)
[/quote]

Thanks for that. W3TC seemed to be helping in a few other aspects:
[list]
[]enabling gzip compression (22 files listed in Chrome audit and its saying I could save ~725kb of loading)
[
]leveraging browser cache (missing cache expirations)
[*]proxy caching (Cache-Control: public)
[/list]

Any suggestions for these???


#4

Ah, Chrome. So … if I told you it’s drunk, would you believe me? :slight_smile:

Varnish is a proxy cache (so I have no idea why they’re tagging you for that in the first place). It also has the ability to handle gzip on it’s own - https://www.varnish-cache.org/docs/trunk/users-guide/compression.html - but we’re not YET on 4.0 so right now. We can try telling it to force gzip via a custom vcl for you - https://www.varnish-cache.org/docs/2.1/tutorial/vary.html - but it’s been really hit or miss, and since people are hitting Varnish and NOT Apache, it’s less of an issue and won’t really speed things up all that much.

As for “leveraging browser cache” … that’s pretty vague since I don’t know WHAT is missing. Chrome/google ALWAYS yells at me that google’s analytics aren’t compressed. ಠ_ಠ‎ And whose fault is THAT Google?


#5

I don’t doubt it but YSlow is showing the same issues :expressionless: Regardless, I appreciate you spending your time on this!

Any word on when v4.0 will be running? I’m interested in this VCL you speak of, but I’m clueless about how/where to be dropping this in or what to be adding it to. Anything to get that gzip. I’m all about the gzips.

I’m outta my league here, but the PageSpeed documentation says to look at the response header.

Looking at: http://www.steamericas.com/wp-content/plugins/revslider/images/dummy.png, which PS is saying doesn’t have an expiration date…

-vs-

http://www.steamericas.com/wp-content/plugins/revslider/rs-plugin/css/settings.css?rev=4.5.7&ver=3.9.1, which it is saying is explicitly not cached…

I’m trying to figure out why they’re returning different results and the only thing I can guess is that having the cache-buster in the resource URL is it.

But this is where W3TC, at the very least, was tricking PS into thinking the resources’ browser cache props were optimized. And my guess is that this was slip-streamed into the HTTP header for the page.

I’m looking at this plugin to see if that satisfies the browser life portion of this riddle: https://wordpress.org/plugins/add-headers/

And I’m looking at these hacks to see if they help: http://gtmetrix.com/add-expires-headers.html


#6

AHA! So I know some of this.

ETA on 4.0 - I do not have one. It’s a BIG change, and there would be a lot of backporting involved.

settings.css?rev=4.5.7&ver=3.9.1 and dummy.png not having have expiration dates is weird, since it SHOULD! If I hit either one directly and look at the headers it has this:

Accept-Ranges:bytes
Age:7
Cache-Control:public, public
Connection:keep-alive
Content-Type:image/png
Date:Fri, 18 Jul 2014 15:55:20 GMT
Expires:Sat, 18 Jul 2015 15:55:13 GMT
Last-Modified:Sat, 12 Jul 2014 00:30:56 GMT
Pragma:public
Server:Apache
Vary:User-Agent
Via:1.1 varnish
X-Cacheable:YES
X-Varnish:1367552328 1367552324

So that has a year expiration (and no, a plugin won’t catch that since I’m hitting the image directly without calling WP). I did the same check on the CSS. If you go here http://www.isvarnishworking.com/ and toss in the URLs, you’ll see what I mean.

That CLEARLY is actually sending Gzip - and again, this is outside of WP, so I don’t know why YSlow and Google PS are being dim about it. The headers are there :frowning:


#7

Interesting discussion, I have also been trying to increase my pageloads on the dreampress site we have and found that W3TC was a big help.
I did try the Varnish cache tester and have been getting a 0 cache time error. Ive tried disabling all of my plugins and putting cloudflare in development mode and I still get this. With the cache age set to 0 i dont see how I can get varnish to help and with the setup I dont see how I can change it so its back to W3TC for now.


HTTP/1.1 200 OK
Server: cloudflare-nginx
Date: Tue, 29 Jul 2014 20:20:36 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=d01ab6934656cc2b573b92817458654981406665236393; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.texasvox.org; HttpOnly
Vary: Accept-Encoding,Cookie
X-Mod-Pagespeed: 1.6.29.7-3566
Cache-Control: max-age=0, no-cache
X-Pingback: http://www.texasvox.org/xmlrpc.php
X-Powered-By: W3 Total Cache/0.9.4
Pragma: public
X-Cacheable: NO:Not Cacheable
X-Varnish: 1232169936
Age: 0
Via: 1.1 varnish
CF-RAY: 151c049f767d0ef1-EWR
Content-Encoding: gzip


#8

Using Bad Behavior is going to mess up Varnish six ways from Sunday right now… It also breaks WPCLI for reasons still unknown :confused:

I would strongly advise against using it right now, and also not using wp-dbmanager or wordfence - They’re GREAT plugins, but they all cause your site to run a bit slower because of how WP has to process those things.


#9

I just found a plugin that seems to have helped my page loads tremendously. I’ve only been testing for an hour or so so it may just be a less than heavy time for Dreamhost in general. BUT… seems to me I’m always told plugins are causing slow load times. It also occurred to me that plugin files are loading on pages that don’t even use that plugin. For example, if I use NEXTgen gallery on a page with no gallery, the gallery plugin still loads. How to stop that?

This plugin allows you to do the following: 1. Change the order that your plugins are loaded. 2. Selectively disable plugins by any post type or wordpress managed URL.

So now I can pick and choose which plugins to use on a per post/page basis.


#10

To a degree you can’t within the plugin. I mean, NextGen has to load to SEE if it needs to load, but it shouldn’t be loading everything on every page. That’s just general plugin optimization, and certainly something to suggest to the devs.


#11

Hello, it seems that W3 total is the best choice for wordpress, can you confirm ? Thanks.


#12

DreamPress already comes with Varnish, so adding more caching plugins will not produce any improvement and most likely will create issues.


#13

Hello, I do not use dreampress but own install on dedicated.


#14

I’ve only been testing for an hour or so so it may just be a less than heavy time for Dreamhost in general. BUT… seems to me I’m always told plugins are causing slow load times.