in HOW, TECH/WORK

 

You’re now ready to restart varnish to take your changes into account:

systemctl restart varnish

 

Now point your favourite browser to your domain, and if you did everything right, you’ll see your varnish-accelerated page.

Alternatively, here’s how it looks for me when I ‘curl’ it from my desktop/laptop:

curl -LIs https://evervee.me

returns:

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 26 Jun 2017 17:49:38 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Age: 7
Via: carrier pigeon and smoke signals
X-Powered-By: hopes and dreams
X-Cache: HIT
Accept-Ranges: bytes
Strict-Transport-Security: max-age=31536000; includeSubDomains

 

Two subsequent curl calls will show how Varnish first didn’t have the resource in memory, but for the second ‘visit’, it definitely serves it from memory, as opposed to letting nginx (which is already fast) process it from disk, which by the sheer nature of physics, is slower, especially at scale.

curl call results on an SSL varnish site

Let me know if any of the steps don’t work for you and I’ll try to help you 🙂
//V

 

Later edit:

Damn this thing is fast! Sub-second response times are fantastic for this exact blog post:

time curl -LIs https://evervee.me/tech-work/wordpress-ssl-php-fpm-nginx-varnish-nginx-sandwich/

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 26 Jun 2017 18:12:01 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Age: 20
Via: carrier pigeon and smoke signals
X-Powered-By: hopes and dreams
X-Cache: HIT
Accept-Ranges: bytes
Strict-Transport-Security: max-age=31536000; includeSubDomains

real 0m0.539s
user 0m0.025s
sys 0m0.009s

That’s including visiting it from North America, and the VPS I’m hosting this on is in Europe (so add the usual 100-200+ ms latency for the data to be crossing that big ass ocean as well)

Without Varnish, the load times are usually in the 3-5 second range, for light pages (not too many big pictures and whatnot)…

So, yay ^^