Enable Varnish Cache Purging on Ubuntu 14.04 PVHVM on Rackspace Cloud Server. This settings is important for WordPress plus W3 Total Cache. We started from here – Install WordPress on Rackspace Cloud Server (Ubuntu 14.04 PVHVM). It is quite important to read this guide – Advanced Tweaks and Optimization for Varnish Cache before you read this article. We usually deliver websites via load balancers. We suggest never to expose port 80 of the server naked to the DNS server. A hacker can get in, but there is no way to get out without leaving a trace if you setup properly in this way.
We told you the part of plan so that you’ll never Enable Varnish Cache Purging with paranormal file permissions, which unfortunately WordPress demands for smooth update. There is no reason to think thatwp-content
directory is not so important.
Read One Person’s Guide to Enable Varnish Cache Purging on Ubuntu 14.04 PVHVM (Rackspace)
If you follow different guides from here and there – Rackspace Guides, Media Template Guides, Our Guides, Another Person’s Guide – there is enough chance to get the things wrong as we usually write in our habituated way. This can be a dangerous point if you are fully new UNIX user. We think, it is better to experiment on a test instance. For example, we usually change the default configuration file of Varnish.
---
We do not use $
as others do but’~ ‘ – or nothing. You must avoid the leading double space. You can Get Started with Varnish Cache from our guide.
Enable Varnish Cache Purging on Ubuntu 14.04 PVHVM
A purge is when you pick out an object from the cache and discard it along with its variants. Usually a purge is invoked through HTTP with the method PURGE
.
Here is the settings page on W3TC Plugin page :
Now on command line :
1 2 | cd /etc/varnish && nano user.vcl # the file will open |
A sample configuration :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | acl purge { "localhost"; "10.210.74.22"/24; } # use service net IP sub vcl_recv { # allow PURGE from 10.210.74.22 if (req.request == "PURGE") { if (!client.ip ~ purge) { error 405 "Not allowed."; } return (lookup); } } sub vcl_hit { if (req.request == "PURGE") { purge; error 200 "Purged."; } } sub vcl_miss { if (req.request == "PURGE") { purge; error 200 "Purged."; } } |