readme changelog updated, stable tag updated 1.4.3
readme changelog updated, stable tag updated

 Binary files a/assets/banner-772x250.png and b/assets/banner-772x250.png differ
 Binary files a/assets/screenshot-1.png and b/assets/screenshot-1.png differ
 Binary files a/assets/screenshot-2.png and b/assets/screenshot-2.png differ
 Binary files a/assets/screenshot-3.png and b/assets/screenshot-3.png differ
 Binary files a/assets/screenshot-4.png and b/assets/screenshot-4.png differ
 Binary files a/assets/screenshot-5.png and b/assets/screenshot-5.png differ
 Binary files /dev/null and b/assets/screenshot-6.png differ
file:a/readme.txt -> file:b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -1,10 +1,10 @@
-=== VCaching ===
+=== Varnish Caching ===
 Donate link: www.paypal.com/use/email/razvan_stanga@yahoo.com
 Contributors: razvanstanga
 Tags: varnish, purge, cache, caching, optimization, performance, traffic
 Requires at least: 4.0
-Tested up to: 4.4
-Stable tag: 1.3.3
+Tested up to: 4.5
+Stable tag: 1.4.3
 License: GPLv2 or later
 
 Wordpress Varnish Cache 3.x/4.x integration
@@ -21,6 +21,7 @@
 * supports every type of Varnish Cache implementation, see screenshots for examples
 * unlimited number of Varnish Cache servers
 * use of custom headers when communicating with Varnish Cache does not interfere with other caching plugins, cloudflare, etc
+* Varnish Cache configuration generator
 * purge key method so you don't need to setup ACLs
 * debugging
 * actively maintained
@@ -33,6 +34,7 @@
 * IPs/Hosts to clear cache to support every type of Varnish Cache implementation
 * Override default TTL in posts/pages
 * Purge key based PURGE
+* Logged in cookie
 * Debugging option
 * console for precise manual purges
 
@@ -58,8 +60,13 @@
 
 == Installation ==
 
-Use the provided config files for Varnish Cache located in /wp-content/plugins/vcaching/varnish-conf folder. Just edit the backend IP/port and ACLs.
-You can also use the purge key method. You must fill in lib/purge.vcl the purge key.
+* You must install Varnish Cache on your server(s)
+* Go to the configuration generator. Fill in the backends/ACLs then download the configuration files
+* Use these configuration files to configure Varnish Cache server(s). Usualy the configuration files are in /etc/varnish. In most cases you must put the downloaded configuration files in /etc/varnish and restart Varnish Cache
+
+Or use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder.
+
+You can also use the purge key method if you can't setup ACLs. You must fill in lib/purge.vcl the purge key.
 
 == Frequently Asked Questions ==
 
@@ -89,13 +96,37 @@
 
 = How do I configure my Varnish Cache VCL? =
 
-Use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder.
+Use the Varnish Cache configuration generator. Fill in the backends/ACLs then download your configuration files.
+Or use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder.
 
 = Can I use this with a proxy service like CloudFlare? =
 
 Yes.
 
+= What is logged in cookie? =
+
+Logged in cookie is a special cookie this plugin sets upon user login. Varnish Cache uses this cookie to bypass caching for logged in users.
+
+This is a small step towards securing your site for denial of service attacks. Denial of service attacks can happen if the attacker bypasses Varnish Cache and hits the backend directly.
+With the current configuration and the way Wordpress works, this can still happen with POST/AJAX requests.
+
 == Changelog ==
+
+= 1.4.3 =
+* Truncate option added for too many 'trying to purge' messages. Added check for ZipArchive class to download VCLs.
+
+= 1.4.2 =
+* Bugfix release. Replaced home_url with plugins_url to show VCaching image
+
+= 1.4.1 =
+* Do not cache static files on admin domain
+
+= 1.4 =
+* Varnish Cache configuration generator
+* added `logged in cookie`. This replaces the logged in admin/user based on Wordpress standard cookies to bypass caching
+* moved backends to conf/backend.vcl
+* moved ACLs to conf/acl.vcl
+* updated VCLs. If you are using 1.3 VCLs should upgrade to 1.4
 
 = 1.3.3 =
 * support for Varnish 4
@@ -127,13 +158,15 @@
 
 == Upgrade Notice ==
 
-* none
+= 1.4 =
+Users using 1.3 Varnish Cache VCLs should upgrade to 1.4
 
 == Screenshots ==
 
-1. admin panel
-2. example integration
-3. override default TTL in posts/pages
-4. console purge
-5. varnish statistics
+1. Settings admin panel
+2. Console/manual purge admin panel
+3. Varnish Cache Statistics admin panel
+4. Varnish Cache configuration generator admin panel
+5. override default TTL in posts/pages
+6. integration example
 

--- /dev/null
+++ b/varnish-conf/v3/conf/acl.vcl
@@ -1,1 +1,10 @@
+acl cloudflare {
+    # set this ip to your Railgun IP (if applicable)
+    # "1.2.3.4";
+}
 
+acl purge {
+    "localhost";
+    "127.0.0.1";
+    #"192.168.0.2";
+}

--- /dev/null
+++ b/varnish-conf/v3/conf/backend.vcl
@@ -1,1 +1,14 @@
+backend backend1 {
+    .host = "192.168.0.2";
+    .port = "80";
+}
 
+director backends round-robin {
+    {
+        .backend = backend1;
+    }
+}
+
+sub vcl_recv {
+    set req.backend = backends;
+}

--- a/varnish-conf/v3/default.vcl
+++ b/varnish-conf/v3/default.vcl
@@ -1,7 +1,5 @@
-backend default {
-    .host = "192.168.0.2";
-    .port = "80";
-}
+include "conf/backend.vcl";
+include "conf/acl.vcl";
 
 import std;
 
@@ -10,17 +8,6 @@
 include "lib/purge.vcl";
 include "lib/bigfiles.vcl";
 include "lib/static.vcl";
-
-acl cloudflare {
-    # set this ip to your Railgun IP (if applicable)
-    # "1.2.3.4";
-}
-
-acl purge {
-    "localhost";
-    "127.0.0.1";
-    #"192.168.0.2";
-}
 
 # Pick just one of the following:
 # (or don't use either of these if your application is "adaptive")
@@ -35,37 +22,40 @@
     }
 
     # redirect yourdomain.com to www.yourdomain.com
-    if (req.http.host ~ "^yourdomain\.com$") {
-        error 750 "http://www.yourdomain.com" + req.url;
-    }
+    #if (req.http.host ~ "^yourdomain\.com$") {
+    #    error 750 "http://www.yourdomain.com" + req.url;
+    #}
 
-    # if you use a subdomain for wp-admin, do not cache it
-    if (req.http.host ~ "admin.yourdomain.com") {
-        return(pass);
-    }
+    # if you use a subdomain for admin section, do not cache it
+    #if (req.http.host ~ "admin.yourdomain.com") {
+    #    set req.http.X-VC-Cacheable = "NO:Admin domain";
+    #    return(pass);
+    #}
 
     ### Check for reasons to bypass the cache!
     # never cache anything except GET/HEAD
     if (req.request != "GET" && req.request != "HEAD") {
+        set req.http.X-VC-Cacheable = "NO:Request method:" + req.request;
         return(pass);
     }
 
-    # don't cache logged-in users. users logged in cookie you can set in settings
+    # don't cache logged-in users. you can set users `logged in cookie` name in settings
     if (req.http.Cookie ~ "c005492c65") {
-        set req.http.X-VC-GotSession = "true";
+        set req.http.X-VC-Cacheable = "NO:Found logged in cookie";
         return(pass);
     }
 
     # don't cache ajax requests
     if (req.http.X-Requested-With == "XMLHttpRequest") {
+        set req.http.X-VC-Cacheable = "NO:Requested with: XMLHttpRequest";
         return(pass);
     }
 
-    # don't cache these special pages
-    if (req.url ~ "nocache|wp-admin|wp-(comments-post|login|activate|mail)\.php|bb-admin|server-status|control\.php|bb-login\.php|bb-reset-password\.php|register\.php") {
-        set req.http.X-VC-GotUrl = "true";
-        return(pass);
-    }
+    # don't cache these special pages. Not needed, left here as example
+    #if (req.url ~ "nocache|wp-admin|wp-(comments-post|login|activate|mail)\.php|bb-admin|server-status|control\.php|bb-login\.php|bb-reset-password\.php|register\.php") {
+    #    set req.http.X-VC-Cacheable = "NO:Special page: " + req.url;
+    #    return(pass);
+    #}
 
     ### looks like we might actually cache it!
     # fix up the request
@@ -89,10 +79,17 @@
 }
 
 sub vcl_hash {
-    # Add the browser cookie only if a WordPress cookie found.
-    if (req.http.Cookie ~ "wp-postpass_|wordpress_logged_in_|comment_author|PHPSESSID") {
-        hash_data(req.http.Cookie);
+    set req.http.hash = req.url;
+    if (req.http.host) {
+        set req.http.hash = req.http.hash + "#" + req.http.host;
+    } else {
+        set req.http.hash = req.http.hash + "#" + server.ip;
     }
+    # Add the browser cookie only if a WordPress cookie found. Not needed, left here as example
+    #if (req.http.Cookie ~ "wp-postpass_|wordpress_logged_in_|comment_author|PHPSESSID") {
+    #    hash_data(req.http.Cookie);
+    #    set req.http.hash = req.http.hash + "#" + req.http.Cookie;
+    #}
 }
 
 sub vcl_fetch {
@@ -111,14 +108,16 @@
         set beresp.ttl = 0s;
     }
 
-    # You don't wish to cache content for logged in users
-    if (req.http.X-VC-GotSession ~ "true" || beresp.http.X-VC-GotSession ~ "true") {
-        set beresp.http.X-VC-Cacheable = "NO:Got Session";
+    # Don't cache object as instructed by header bereq.X-VC-Cacheable
+    if (req.http.X-VC-Cacheable ~ "^NO") {
+        set beresp.http.X-VC-Cacheable = req.http.X-VC-Cacheable;
         return(hit_for_pass);
 
     # Varnish determined the object was not cacheable
     } else if (beresp.ttl <= 0s) {
-        set beresp.http.X-VC-Cacheable = "NO:Not Cacheable";
+        if (!beresp.http.X-VC-Cacheable) {
+            set beresp.http.X-VC-Cacheable = "NO:Not cacheable, ttl: "+ beresp.ttl;
+        }
         return(hit_for_pass);
 
     # You are respecting the Cache-Control=private header from the backend
@@ -126,13 +125,17 @@
         set beresp.http.X-VC-Cacheable = "NO:Cache-Control=private";
         return(hit_for_pass);
 
-    # You are respecting the X-VC-Enabled=true header from the backend
+    # Cache object
     } else if (beresp.http.X-VC-Enabled ~ "true") {
-        set beresp.http.X-VC-Cacheable = "YES";
+        if (!beresp.http.X-VC-Cacheable) {
+            set beresp.http.X-VC-Cacheable = "YES:Is cacheable, ttl: " + beresp.ttl;
+        }
 
     # Do not cache object
     } else if (beresp.http.X-VC-Enabled ~ "false") {
-        set beresp.http.X-VC-Cacheable = "NO:Disabled";
+        if (!beresp.http.X-VC-Cacheable) {
+            set beresp.http.X-VC-Cacheable = "NO:Disabled";
+        }
         set beresp.ttl = 0s;
     }
 

--- a/varnish-conf/v3/lib/purge.vcl
+++ b/varnish-conf/v3/lib/purge.vcl
@@ -33,8 +33,9 @@
 # always set the X-VC-Purge-Method header.
 
 sub vcl_recv {
+    set req.http.X-VC-My-Purge-Key = "ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4";
     if (req.request == "PURGE") {
-        if (req.http.X-VC-Purge-Key == "ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4") {
+        if (req.http.X-VC-Purge-Key == req.http.X-VC-My-Purge-Key) {
             set req.http.X-VC-Purge-Key-Auth = "true";
         } else {
             set req.http.X-VC-Purge-Key-Auth = "false";
@@ -64,6 +65,10 @@
         }
         error 200 "Purged " + req.url + " " + req.http.host;
     }
+    unset req.http.X-VC-My-Purge-Key;
+    # unset Varnish Caching custom headers from client
+    unset req.http.X-VC-Cacheable;
+    unset req.http.X-VC-Debug;
 }
 
 sub vcl_fetch {
@@ -83,17 +88,19 @@
         set resp.http.X-VC-Cache = "MISS";
     }
 
-    if (resp.http.X-VC-Debug ~ "true") {
-        set resp.http.X-VC-Hash = req.url+"#"+req.http.host;
+    if (req.http.X-VC-Debug ~ "true" || resp.http.X-VC-Debug ~ "true") {
+        set resp.http.X-VC-Hash = req.http.hash;
+        if (req.http.X-VC-DebugMessage) {
+            set resp.http.X-VC-DebugMessage = req.http.X-VC-DebugMessage;
+        }
     } else {
         unset resp.http.X-VC-Enabled;
         unset resp.http.X-VC-Cache;
         unset resp.http.X-VC-Debug;
+        unset resp.http.X-VC-DebugMessage;
         unset resp.http.X-VC-Cacheable;
         unset resp.http.X-VC-Purge-Key-Auth;
         unset resp.http.X-VC-TTL;
-        unset resp.http.X-VC-GotSession;
-        unset resp.http.X-VC-GotUrl;
     }
 }
 

--- a/varnish-conf/v3/lib/static.vcl
+++ b/varnish-conf/v3/lib/static.vcl
@@ -2,10 +2,20 @@
 
 sub vcl_recv {
     if (req.request ~ "^(GET|HEAD)$" && req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)(\?.*)?$") {
-        # disable this if you want
-        if (req.url ~ "nocache") {
-            return(pass);
-        }
+        # if you use a subdomain for admin section, do not cache it
+        #if (req.http.host ~ "admin.yourdomain.com") {
+        #    set req.http.X-VC-Cacheable = "NO:Admin domain";
+        #    return(pass);
+        #}
+        # enable this if you want
+        #if (req.url ~ "debug") {
+        #    set req.http.X-VC-Debug = "true";
+        #}
+        # enable this if you need it
+        #if (req.url ~ "nocache") {
+        #    set req.http.X-VC-Cacheable = "NO:Not cacheable, nocache in URL";
+        #    return(pass);
+        #}
         set req.url = regsub(req.url, "\?.*$", "");
         # unset cookie only if no http auth
         if (!req.http.Authorization) {
@@ -19,8 +29,9 @@
 sub vcl_fetch {
     if (req.request ~ "^(GET|HEAD)$" && req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$") {
         # overwrite ttl with X-VC-TTL
-        set beresp.http.X-VC-TTL = "24";
-        set beresp.ttl = std.duration(beresp.http.X-VC-TTL + "h", 0s);
+        set beresp.http.X-VC-TTL = 24*60*60;
+        set beresp.ttl = std.duration(beresp.http.X-VC-TTL + "s", 0s);
+        set beresp.http.X-VC-Cacheable = "YES:Is cacheable, ttl: " + beresp.ttl;
         set beresp.grace = 2m;
     }
 }

--- /dev/null
+++ b/varnish-conf/v4/conf/acl.vcl
@@ -1,1 +1,10 @@
+acl cloudflare {
+    # set this ip to your Railgun IP (if applicable)
+    # "1.2.3.4";
+}
 
+acl purge {
+    "localhost";
+    "127.0.0.1";
+    #"192.168.0.2";
+}

--- /dev/null
+++ b/varnish-conf/v4/conf/backend.vcl
@@ -1,1 +1,16 @@
+import directors;
 
+backend backend1 {
+    .host = "192.168.0.2";
+    .port = "80";
+}
+
+sub vcl_init {
+    new backends = directors.round_robin();
+    backends.add_backend(backend1);
+}
+
+sub vcl_recv {
+    set req.backend_hint = backends.backend();
+}
+

--- a/varnish-conf/v4/default.vcl
+++ b/varnish-conf/v4/default.vcl
@@ -1,9 +1,7 @@
 vcl 4.0;
 
-backend default {
-    .host = "192.168.0.2";
-    .port = "80";
-}
+include "conf/backend.vcl";
+include "conf/acl.vcl";
 
 import std;
 
@@ -12,17 +10,6 @@
 include "lib/purge.vcl";
 include "lib/bigfiles.vcl";
 include "lib/static.vcl";
-
-acl cloudflare {
-    # set this ip to your Railgun IP (if applicable)
-    # "1.2.3.4";
-}
-
-acl purge {
-    "localhost";
-    "127.0.0.1";
-    #"192.168.0.2";
-}
 
 # Pick just one of the following:
 # (or don't use either of these if your application is "adaptive")
@@ -37,38 +24,41 @@
     }
 
     # redirect yourdomain.com to www.yourdomain.com
-    if (req.http.host ~ "^yourdomain\.com$") {
-        set req.http.X-VC-Redirect = "http://www.yourdomain.com" + req.url;
-        return (synth(750, "Moved permanently"));
-    }
+    #if (req.http.host ~ "^yourdomain\.com$") {
+    #    set req.http.X-VC-Redirect = "http://www.yourdomain.com" + req.url;
+    #    return (synth(750, "Moved permanently"));
+    #}
 
-    # if you use a subdomain for wp-admin, do not cache it
-    if (req.http.host ~ "admin.yourdomain.com") {
-        return(pass);
-    }
+    # if you use a subdomain for admin section, do not cache it
+    #if (req.http.host ~ "admin.yourdomain.com") {
+    #    set req.http.X-VC-Cacheable = "NO:Admin domain";
+    #    return(pass);
+    #}
 
     ### Check for reasons to bypass the cache!
     # never cache anything except GET/HEAD
     if (req.method != "GET" && req.method != "HEAD") {
+        set req.http.X-VC-Cacheable = "NO:Request method:" + req.method;
         return(pass);
     }
 
     # don't cache logged-in users. you can set users `logged in cookie` name in settings
     if (req.http.Cookie ~ "c005492c65") {
-        set req.http.X-VC-GotSession = "true";
+        set req.http.X-VC-Cacheable = "NO:Found logged in cookie";
         return(pass);
     }
 
     # don't cache ajax requests
     if (req.http.X-Requested-With == "XMLHttpRequest") {
+        set req.http.X-VC-Cacheable = "NO:Requested with: XMLHttpRequest";
         return(pass);
     }
 
-    # don't cache these special pages
-    if (req.url ~ "nocache|wp-admin|wp-(comments-post|login|activate|mail)\.php|bb-admin|server-status|control\.php|bb-login\.php|bb-reset-password\.php|register\.php") {
-        set req.http.X-VC-GotUrl = "true";
-        return(pass);
-    }
+    # don't cache these special pages. Not needed, left here as example
+    #if (req.url ~ "nocache|wp-admin|wp-(comments-post|login|activate|mail)\.php|bb-admin|server-status|control\.php|bb-login\.php|bb-reset-password\.php|register\.php") {
+    #    set req.http.X-VC-Cacheable = "NO:Special page: " + req.url;
+    #    return(pass);
+    #}
 
     ### looks like we might actually cache it!
     # fix up the request
@@ -91,10 +81,17 @@
 }
 
 sub vcl_hash {
-    # Add the browser cookie only if a WordPress cookie found.
-    if (req.http.Cookie ~ "wp-postpass_|wordpress_logged_in_|comment_author|PHPSESSID") {
-        hash_data(req.http.Cookie);
+    set req.http.hash = req.url;
+    if (req.http.host) {
+        set req.http.hash = req.http.hash + "#" + req.http.host;
+    } else {
+        set req.http.hash = req.http.hash + "#" + server.ip;
     }
+    # Add the browser cookie only if cookie found. Not needed, left here as example
+    #if (req.http.Cookie ~ "wp-postpass_|wordpress_logged_in_|comment_author|PHPSESSID") {
+    #    hash_data(req.http.Cookie);
+    #    set req.http.hash = req.http.hash + "#" + req.http.Cookie;
+    #}
 }
 
 sub vcl_backend_response {
@@ -113,15 +110,17 @@
         set beresp.ttl = 0s;
     }
 
-    # You don't wish to cache content for logged in users
-    if (bereq.http.X-VC-GotSession ~ "true" || beresp.http.X-VC-GotSession ~ "true") {
-        set beresp.http.X-VC-Cacheable = "NO:Got Session";
+    # Don't cache object as instructed by header bereq.X-VC-Cacheable
+    if (bereq.http.X-VC-Cacheable ~ "^NO") {
+        set beresp.http.X-VC-Cacheable = bereq.http.X-VC-Cacheable;
         set beresp.uncacheable = true;
         set beresp.ttl = 120s;
 
-    # Varnish determined the object was not cacheable
+    # Varnish determined the object is not cacheable
     } else if (beresp.ttl <= 0s) {
-        set beresp.http.X-VC-Cacheable = "NO:Not Cacheable";
+        if (!beresp.http.X-VC-Cacheable) {
+            set beresp.http.X-VC-Cacheable = "NO:Not cacheable, ttl: "+ beresp.ttl;
+        }
         set beresp.uncacheable = true;
         set beresp.ttl = 120s;
 
@@ -131,13 +130,17 @@
         set beresp.uncacheable = true;
         set beresp.ttl = 120s;
 
-    # You are respecting the X-VC-Enabled=true header from the backend
+    # Cache object
     } else if (beresp.http.X-VC-Enabled ~ "true") {
-        set beresp.http.X-VC-Cacheable = "YES";
+        if (!beresp.http.X-VC-Cacheable) {
+            set beresp.http.X-VC-Cacheable = "YES:Is cacheable, ttl: " + beresp.ttl;
+        }
 
     # Do not cache object
     } else if (beresp.http.X-VC-Enabled ~ "false") {
-        set beresp.http.X-VC-Cacheable = "NO:Disabled";
+        if (!beresp.http.X-VC-Cacheable) {
+            set beresp.http.X-VC-Cacheable = "NO:Disabled";
+        }
         set beresp.ttl = 0s;
     }
 

--- a/varnish-conf/v4/lib/bigfiles.vcl
+++ b/varnish-conf/v4/lib/bigfiles.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # bigfiles.vcl -- Bypass Cache for Large Files
 
 sub vcl_backend_response {

--- a/varnish-conf/v4/lib/bigfiles_pipe.vcl
+++ b/varnish-conf/v4/lib/bigfiles_pipe.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # bigfiles_pipe.vcl -- Pipe for Large Files
 
 # You must have "import std;" in your main vcl:

--- a/varnish-conf/v4/lib/cloudflare.vcl
+++ b/varnish-conf/v4/lib/cloudflare.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # cloudflare.vcl -- CloudFlare HTTP Headers
 
 # This should generally be loaded first to make sure that the headers

--- a/varnish-conf/v4/lib/mobile_cache.vcl
+++ b/varnish-conf/v4/lib/mobile_cache.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # mobile_cache.vcl -- Separate cache for mobile clients
 
 # If the User-Agent looks like a mobile device, then we add the string

--- a/varnish-conf/v4/lib/mobile_pass.vcl
+++ b/varnish-conf/v4/lib/mobile_pass.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # mobile_pass.vcl -- Mobile pass-through support for Varnish
 
 # This simply bypasses the cache for anything that looks like a mobile

--- a/varnish-conf/v4/lib/purge.vcl
+++ b/varnish-conf/v4/lib/purge.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # purge.vcl -- Cache Purge Library for Varnish
 
 # Regex purging
@@ -34,8 +33,9 @@
 # always set the X-VC-Purge-Method header.
 
 sub vcl_recv {
+    set req.http.X-VC-My-Purge-Key = "ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4";
     if (req.method == "PURGE") {
-        if (req.http.X-VC-Purge-Key == "ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4") {
+        if (req.http.X-VC-Purge-Key == req.http.X-VC-My-Purge-Key) {
             set req.http.X-VC-Purge-Key-Auth = "true";
         } else {
             set req.http.X-VC-Purge-Key-Auth = "false";
@@ -65,6 +65,10 @@
         }
         return (synth(200,"Purged " + req.url + " " + req.http.host));
     }
+    unset req.http.X-VC-My-Purge-Key;
+    # unset Varnish Caching custom headers from client
+    unset req.http.X-VC-Cacheable;
+    unset req.http.X-VC-Debug;
 }
 
 sub vcl_backend_response {
@@ -84,17 +88,19 @@
         set resp.http.X-VC-Cache = "MISS";
     }
 
-    if (resp.http.X-VC-Debug ~ "true") {
-        set resp.http.X-VC-Hash = req.url+"#"+req.http.host;
+    if (req.http.X-VC-Debug ~ "true" || resp.http.X-VC-Debug ~ "true") {
+        set resp.http.X-VC-Hash = req.http.hash;
+        if (req.http.X-VC-DebugMessage) {
+            set resp.http.X-VC-DebugMessage = req.http.X-VC-DebugMessage;
+        }
     } else {
         unset resp.http.X-VC-Enabled;
         unset resp.http.X-VC-Cache;
         unset resp.http.X-VC-Debug;
+        unset resp.http.X-VC-DebugMessage;
         unset resp.http.X-VC-Cacheable;
         unset resp.http.X-VC-Purge-Key-Auth;
         unset resp.http.X-VC-TTL;
-        unset resp.http.X-VC-GotSession;
-        unset resp.http.X-VC-GotUrl;
     }
 }
 

--- a/varnish-conf/v4/lib/static.vcl
+++ b/varnish-conf/v4/lib/static.vcl
@@ -1,12 +1,21 @@
-vcl 4.0;
 # static.vcl -- Static File Caching for Varnish
 
 sub vcl_recv {
     if (req.method ~ "^(GET|HEAD)$" && req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)(\?.*)?$") {
-        # disable this if you want
-        if (req.url ~ "nocache") {
-            return(pass);
-        }
+        # if you use a subdomain for admin section, do not cache it
+        #if (req.http.host ~ "admin.yourdomain.com") {
+        #    set req.http.X-VC-Cacheable = "NO:Admin domain";
+        #    return(pass);
+        #}
+        # enable this if you want
+        #if (req.url ~ "debug") {
+        #    set req.http.X-VC-Debug = "true";
+        #}
+        # enable this if you need it
+        #if (req.url ~ "nocache") {
+        #    set req.http.X-VC-Cacheable = "NO:Not cacheable, nocache in URL";
+        #    return(pass);
+        #}
         set req.url = regsub(req.url, "\?.*$", "");
         # unset cookie only if no http auth
         if (!req.http.Authorization) {
@@ -19,8 +28,9 @@
 sub vcl_backend_response {
     if (bereq.method ~ "^(GET|HEAD)$" && bereq.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$") {
         # overwrite ttl with X-VC-TTL
-        set beresp.http.X-VC-TTL = "24";
-        set beresp.ttl = std.duration(beresp.http.X-VC-TTL + "h", 0s);
+        set beresp.http.X-VC-TTL = 24*60*60;
+        set beresp.ttl = std.duration(beresp.http.X-VC-TTL + "s", 0s);
+        set beresp.http.X-VC-Cacheable = "YES:Is cacheable, ttl: " + beresp.ttl;
     }
 }
 

--- a/varnish-conf/v4/lib/xforward.vcl
+++ b/varnish-conf/v4/lib/xforward.vcl
@@ -1,4 +1,3 @@
-vcl 4.0;
 # xforward.vcl -- X-Forwarded-For HTTP Headers
 
 # This should generally be loaded first to make sure that the headers

--- a/vcaching.php
+++ b/vcaching.php
@@ -1,9 +1,9 @@
 <?php
 /*
-Plugin Name: VCaching
+Plugin Name: Varnish Caching
 Plugin URI: http://wordpress.org/extend/plugins/vcaching/
 Description: WordPress Varnish Cache integration.
-Version: 1.3.3
+Version: 1.4.3
 Author: Razvan Stanga
 Author URI: http://git.razvi.ro/
 License: http://www.apache.org/licenses/LICENSE-2.0
@@ -29,6 +29,7 @@
     protected $override = 0;
     protected $customFields = array();
     protected $noticeMessage = '';
+    protected $truncateNotice = false;
     protected $debug = 0;
 
     public function __construct()
@@ -63,6 +64,7 @@
         add_action('wp', array($this, 'buffer_start'), 1000000);
         add_action('shutdown', array($this, 'buffer_end'), 1000000);
 
+        $this->truncateNotice = get_option($this->prefix . 'truncate_notice');
         $this->debug = get_option($this->prefix . 'debug');
 
         // send headers to varnish
@@ -218,7 +220,7 @@
                                 echo '<p><strong>' . $customField['title'] . '</strong></p>';
                                 echo '<label class="screen-reader-text" for="' . $this->prefix . $customField['name'] . '">' . $customField['title'] . '</label>';
                                 echo '<p><input type="checkbox" name="' . $this->prefix . $customField['name'] . '" id="' . $this->prefix . $customField['name'] . '" value="yes"';
-                                if (get_post_meta( $post->ID, $this->prefix . $customField['name'], true ) == "yes")
+                                if (get_post_meta($post->ID, $this->prefix . $customField['name'], true ) == "yes")
                                     echo ' checked="checked"';
                                 echo '" style="width: auto;" /></p>';
                                 break;
@@ -356,14 +358,19 @@
                     }
                 }
             } else {
-                $this->noticeMessage .= '<br />' . __('Trying to purge URL :', $this->plugin) . $purgeme;
-                $message = preg_match("/<title>(.*)<\/title>/i", $response['body'], $matches);
-                $this->noticeMessage .= ' => <br /> ' . isset($matches[1]) ? " => " . $matches[1] : $response['body'];
-                $this->noticeMessage .= '<br />';
-                if ($this->debug) {
-                    $this->noticeMessage .= $response['body'] . "<br />";
+                if ($this->truncateNotice && $key <= 2 || $this->truncateNotice == false) {
+                    $this->noticeMessage .= '' . __('Trying to purge URL :', $this->plugin) . $purgeme;
+                    preg_match("/<title>(.*)<\/title>/i", $response['body'], $matches);
+                    $this->noticeMessage .= ' => <br /> ' . isset($matches[1]) ? " => " . $matches[1] : $response['body'];
+                    $this->noticeMessage .= '<br />';
+                    if ($this->debug) {
+                        $this->noticeMessage .= $response['body'] . "<br />";
+                    }
                 }
             }
+        }
+        if ($this->truncateNotice) {
+            $this->noticeMessage .= '<br />' . __('Truncate message activated. Showing only first 3 messages.', $this->plugin);
         }
 
         do_action('after_purge_url', $url, $purgeme);
@@ -388,21 +395,21 @@
             $categories = get_the_category($postId);
             if ($categories) {
                 foreach ($categories as $cat) {
-                    array_push($listofurls, get_category_link( $cat->term_id));
+                    array_push($listofurls, get_category_link($cat->term_id));
                 }
             }
             // Tag purge based on Donnacha's work in WP Super Cache
             $tags = get_the_tags($postId);
             if ($tags) {
                 foreach ($tags as $tag) {
-                    array_push($listofurls, get_tag_link( $tag->term_id));
+                    array_push($listofurls, get_tag_link($tag->term_id));
                 }
             }
 
             // Author URL
             array_push($listofurls,
-                get_author_posts_url(get_post_field( 'post_author', $postId)),
-                get_author_feed_link(get_post_field( 'post_author', $postId))
+                get_author_posts_url(get_post_field('post_author', $postId)),
+                get_author_feed_link(get_post_field('post_author', $postId))
             );
 
             // Archives and their feeds
@@ -450,7 +457,12 @@
         $enable = get_option($this->prefix . 'enable');
         if ($enable) {
             Header('X-VC-Enabled: true', true);
-            $ttl = get_option($this->prefix . 'ttl');
+            if (is_user_logged_in()) {
+                Header('X-VC-Cacheable: NO:User is logged in', true);
+                $ttl = 0;
+            } else {
+                $ttl = get_option($this->prefix . 'ttl');
+            }
             Header('X-VC-TTL: ' . $ttl, true);
             if ($debug = get_option($this->prefix . 'debug')) {
                 Header('X-VC-Debug: true', true);
@@ -477,12 +489,13 @@
         add_action('admin_menu', array($this, 'add_menu_item'));
         add_action('admin_init', array($this, 'options_page_fields'));
         add_action('admin_init', array($this, 'console_page_fields'));
+        add_action('admin_init', array($this, 'conf_page_fields'));
     }
 
     public function add_menu_item()
     {
         if ($this->check_if_purgeable()) {
-            add_menu_page(__('Varnish Caching', $this->plugin), __('Varnish Caching', $this->plugin), 'manage_options', $this->plugin . '-plugin', array($this, 'settings_page'), home_url() . '/wp-content/plugins/' . $this->plugin . '/icon.png', 99);
+            add_menu_page(__('Varnish Caching', $this->plugin), __('Varnish Caching', $this->plugin), 'manage_options', $this->plugin . '-plugin', array($this, 'settings_page'), plugins_url() . '/' . $this->plugin . '/icon.png', 99);
         }
     }
 
@@ -498,6 +511,7 @@
                 <a class="nav-tab <?php if($_GET['tab'] == 'console'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=console"><?=__('Console', $this->plugin)?></a>
             <?php endif; ?>
             <a class="nav-tab <?php if($_GET['tab'] == 'stats'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=stats"><?=__('Statistics', $this->plugin)?></a>
+            <a class="nav-tab <?php if($_GET['tab'] == 'conf'): ?>nav-tab-active<?php endif; ?>" href="<?php echo admin_url() ?>index.php?page=<?=$this->plugin?>-plugin&amp;tab=conf"><?=__('Varnish VCLs', $this->plugin)?></a>
         </h2>
 
         <?php if(!isset($_GET['tab']) || $_GET['tab'] == 'options'): ?>
@@ -580,13 +594,9 @@
                             jQuery.getJSON("<?=$ipToHost['statsJson']?>", function(data) {
                                 var server = '#server_<?=$server?>';
                                 jQuery(server).html('');
-                                jQuery(server).append("<?= __('Stats generated on', $this->plugin) ?> " + data.timestamp);
-                                jQuery(server).append('<table class="fixed server_<?=$server?>">');
-                                jQuery(server).append('<thead><tr><td><strong><?= __('Description', $this->plugin) ?></strong></td><td><strong><?= __('Value', $this->plugin) ?></strong></td><td><strong><?= __('Key', $this->plugin) ?></strong></td></tr></thead>');
-                                jQuery(server).append('<tbody id="varnishstats_<?=$server?>"></tbody>');
-                                jQuery(server).append('</table>');
+                                jQuery(server).append('<p><?= __('Stats generated on', $this->plugin) ?> ' + data.timestamp + '</p>');
+                                jQuery(server).append('<table class="wp-list-table widefat fixed striped server_<?=$server?>"><thead><tr><td class="manage-column"><strong><?= __('Description', $this->plugin) ?></strong></td><td class="manage-column"><strong><?= __('Value', $this->plugin) ?></strong></td><td class="manage-column"><strong><?= __('Key', $this->plugin) ?></strong></td></tr></thead><tbody id="varnishstats_<?=$server?>"></tbody></table>');
                                 delete data.timestamp;
-                                console.log(data);
                                 jQuery.each(data, function(key, val) {
                                     jQuery('#varnishstats_<?=$server?>').append('<tr><td>'+val.description+'</td><td>'+val.value+'</td><td>'+key+'</td></tr>');
                                 });
@@ -604,6 +614,30 @@
                     </script>
                 <?php endif; ?>
             </div>
+        <?php elseif($_GET['tab'] == 'conf'): ?>
+            <form method="post" action="options.php">
+                <?php
+                    settings_fields($this->prefix . 'conf');
+                    do_settings_sections($this->prefix . 'conf');
+                    submit_button();
+                ?>
+            </form>
+            <?php if (class_exists('ZipArchive')): ?>
+                <form method="post" action="index.php?page=<?=$this->plugin?>-plugin&amp;tab=conf">
+                    <?php
+                        settings_fields($this->prefix . 'download');
+                        do_settings_sections($this->prefix . 'download');
+                        submit_button(__('Download'));
+                    ?>
+                </form>
+            <?php else: ?>
+                <?php
+                    do_settings_sections($this->prefix . 'download_error');
+                    echo sprintf(__('You server\'s PHP configuration is missing the ZIP extension (ZipArchive class is used by VCaching). Please enable the ZIP extension. For more information click <a href="%1$s" target="_blank">here</a>.', $this->plugin), 'http://www.php.net/manual/en/book.zip.php');
+                    echo "<br />";
+                    echo __('If you cannot enable the ZIP extension, please use the provided Varnish Cache configuration files located in /wp-content/plugins/vcaching/varnish-conf folder', $this->plugin);
+                ?>
+            <?php endif; ?>
         <?php endif; ?>
         </div>
     <?php
@@ -625,6 +659,7 @@
         add_settings_field($this->prefix . "purge_key", __("Purge key", $this->plugin), array($this, $this->prefix . "purge_key"), $this->prefix . 'options', $this->prefix . 'options');
         add_settings_field($this->prefix . "cookie", __("Logged in cookie", $this->plugin), array($this, $this->prefix . "cookie"), $this->prefix . 'options', $this->prefix . 'options');
         add_settings_field($this->prefix . "stats_json_file", __("Statistics JSONs", $this->plugin), array($this, $this->prefix . "stats_json_file"), $this->prefix . 'options', $this->prefix . 'options');
+        add_settings_field($this->prefix . "truncate_notice", __("Truncate notice message", $this->plugin), array($this, $this->prefix . "truncate_notice"), $this->prefix . 'options', $this->prefix . 'options');
         add_settings_field($this->prefix . "debug", __("Enable debug", $this->plugin), array($this, $this->prefix . "debug"), $this->prefix . 'options', $this->prefix . 'options');
 
         if($_POST['option_page'] == $this->prefix . 'options') {
@@ -638,6 +673,7 @@
             register_setting($this->prefix . 'options', $this->prefix . "purge_key");
             register_setting($this->prefix . 'options', $this->prefix . "cookie");
             register_setting($this->prefix . 'options', $this->prefix . "stats_json_file");
+            register_setting($this->prefix . 'options', $this->prefix . "truncate_notice");
             register_setting($this->prefix . 'options', $this->prefix . "debug");
         }
     }
@@ -705,7 +741,7 @@
     public function varnish_caching_purge_key()
     {
         ?>
-            <input type="text" name="varnish_caching_purge_key" id="varnish_caching_purge_key" size="100" value="<?php echo get_option($this->prefix . 'purge_key', 'ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4'); ?>" />
+            <input type="text" name="varnish_caching_purge_key" id="varnish_caching_purge_key" size="100" value="<?php echo get_option($this->prefix . 'purge_key'); ?>" />
             <span onclick="generateHash(64, 0, 'varnish_caching_purge_key'); return false;" class="dashicons dashicons-image-rotate" title="<?=__('Generate')?>"></span>
             <p class="description">
                 <?=__('Key used to purge Varnish cache. It is sent to Varnish as X-VC-Purge-Key header. Use a SHA-256 hash.<br />If you can\'t use ACL\'s, use this option. You can set the `purge key` in lib/purge.vcl.<br />Search the default value ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4 to find where to replace it.', $this->plugin)?>
@@ -716,7 +752,7 @@
     public function varnish_caching_cookie()
     {
         ?>
-            <input type="text" name="varnish_caching_cookie" id="varnish_caching_cookie" size="10" maxlength="10" value="<?php echo get_option($this->prefix . 'cookie', 'c005492c65'); ?>" />
+            <input type="text" name="varnish_caching_cookie" id="varnish_caching_cookie" size="10" maxlength="10" value="<?php echo get_option($this->prefix . 'cookie'); ?>" />
             <span onclick="generateHash(10, 0, 'varnish_caching_cookie'); return false;" class="dashicons dashicons-image-rotate" title="<?=__('Generate')?>"></span>
             <p class="description">
                 <?=__('This module sets a special cookie to tell Varnish that the user is logged in. This should be a random 10 chars string [0-9a-z]. You can set the `logged in cookie` in default.vcl.<br />Search the default value <i>c005492c65</i> to find where to replace it.', $this->plugin)?>
@@ -734,6 +770,16 @@
         <?php
     }
 
+    public function varnish_caching_truncate_notice()
+    {
+        ?>
+            <input type="checkbox" name="varnish_caching_truncate_notice" value="1" <?php checked(1, get_option($this->prefix . 'truncate_notice'), true); ?> />
+            <p class="description">
+                <?=__('When using multiple Varnish Cache servers, VCaching shows too many `Trying to purge URL` messages. Check this option to truncate that message.', $this->plugin)?>
+            </p>
+        <?php
+    }
+
     public function varnish_caching_debug()
     {
         ?>
@@ -758,6 +804,161 @@
             <p class="description"><?=__('Relative URL to purge. Example : /wp-content/uploads/.*', $this->plugin)?></p>
         <?php
     }
+
+    public function conf_page_fields()
+    {
+        add_settings_section('conf', __("Varnish configuration", $this->plugin), null, $this->prefix . 'conf');
+
+        add_settings_field($this->prefix . "varnish_backends", __("Backends", $this->plugin), array($this, $this->prefix . "varnish_backends"), $this->prefix . 'conf', "conf");
+        add_settings_field($this->prefix . "varnish_acls", __("ACLs", $this->plugin), array($this, $this->prefix . "varnish_acls"), $this->prefix . 'conf', "conf");
+
+        if($_POST['option_page'] == $this->prefix . 'conf') {
+            register_setting($this->prefix . 'conf', $this->prefix . "varnish_backends");
+            register_setting($this->prefix . 'conf', $this->prefix . "varnish_acls");
+        }
+
+        add_settings_section('download', __("Get configuration files", $this->plugin), null, $this->prefix . 'download');
+        if (!class_exists('ZipArchive')) {
+            add_settings_section('download_error', __("You cannot download the configuration files", $this->plugin), null, $this->prefix . 'download_error');
+        }
+
+        add_settings_field($this->prefix . "varnish_version", __("Version", $this->plugin), array($this, $this->prefix . "varnish_version"), $this->prefix . 'download', "download");
+
+        if($_POST['option_page'] == $this->prefix . 'download') {
+            $version = in_array($_POST['varnish_caching_varnish_version'], array(3,4)) ? $_POST['varnish_caching_varnish_version'] : 3;
+            $tmpfile = tempnam("tmp", "zip");
+            $zip = new ZipArchive();
+            $zip->open($tmpfile, ZipArchive::OVERWRITE);
+            $files = array(
+                'default.vcl' => true,
+                'LICENSE' => false,
+                'README.rst' => false,
+                'conf/acl.vcl' => true,
+                'conf/backend.vcl' => true,
+                'lib/bigfiles.vcl' => false,
+                'lib/bigfiles_pipe.vcl' => false,
+                'lib/cloudflare.vcl' => false,
+                'lib/mobile_cache.vcl' => false,
+                'lib/mobile_pass.vcl' => false,
+                'lib/purge.vcl' => true,
+                'lib/static.vcl' => false,
+                'lib/xforward.vcl' => false,
+            );
+            foreach ($files as $file => $parse) {
+                $filepath = __DIR__ . '/varnish-conf/v' . $version . '/' . $file;
+                if ($parse) {
+                    $content = $this->_parse_conf_file($version, $file, file_get_contents($filepath));
+                } else {
+                    $content = file_get_contents($filepath);
+                }
+                $zip->addFromString($file, $content);
+            }
+            $zip->close();
+            header('Content-Type: application/zip');
+            header('Content-Length: ' . filesize($tmpfile));
+            header('Content-Disposition: attachment; filename="varnish_v' . $version . '_conf.zip"');
+            readfile($tmpfile);
+            unlink($tmpfile);
+            exit();
+        }
+    }
+
+    public function varnish_caching_varnish_version()
+    {
+        ?>
+            <select name="varnish_caching_varnish_version" id="varnish_caching_varnish_version">
+                <option value="3">3</option>
+                <option value="4">4</option>
+            </select>
+            <p class="description"><?=__('Varnish Cache version', $this->plugin)?></p>
+        <?php
+    }
+
+    public function varnish_caching_varnish_backends()
+    {
+        ?>
+            <input type="text" name="varnish_caching_varnish_backends" id="varnish_caching_varnish_backends" size="100" value="<?php echo get_option($this->prefix . 'varnish_backends'); ?>" />
+            <p class="description"><?=__('Comma separated ip/ip:port. Example : 192.168.0.2,192.168.0.3:8080', $this->plugin)?></p>
+        <?php
+    }
+
+    public function varnish_caching_varnish_acls()
+    {
+        ?>
+            <input type="text" name="varnish_caching_varnish_acls" id="varnish_caching_varnish_acls" size="100" value="<?php echo get_option($this->prefix . 'varnish_acls'); ?>" />
+            <p class="description"><?=__('Comma separated ip/ip range. Example : 192.168.0.2,192.168.1.1/24', $this->plugin)?></p>
+        <?php
+    }
+
+    private function _parse_conf_file($version, $file, $content)
+    {
+        if ($file == 'default.vcl') {
+            $logged_in_cookie = get_option($this->prefix . 'cookie');
+            $content = str_replace('c005492c65', $logged_in_cookie, $content);
+        } else if ($file == 'conf/backend.vcl') {
+            if ($version == 3) {
+                $content = "";
+            } else if ($version == 4) {
+                $content = "import directors;\n\n";
+            }
+            $backend = array();
+            $ips = get_option($this->prefix . 'varnish_backends');
+            $ips = explode(',', $ips);
+            $id = 1;
+            foreach ($ips as $ip) {
+                if (strstr($ip, ":")) {
+                    $_ip = explode(':', $ip);
+                    $ip = $_ip[0];
+                    $port = $_ip[1];
+                } else {
+                    $port = 80;
+                }
+                $content .= "backend backend" . $id . " {\n";
+                $content .= "\t.host = \"" . $ip . "\";\n";
+                $content .= "\t.port = \"" . $port . "\";\n";
+                $content .= "}\n";
+                $backend[3] .= "\t{\n";
+                $backend[3] .= "\t\t.backend = backend" . $id . ";\n";
+                $backend[3] .= "\t}\n";
+                $backend[4] .= "\tbackends.add_backend(backend" . $id . ");\n";
+                $id++;
+            }
+            if ($version == 3) {
+                $content .= "\ndirector backends round-robin {\n";
+                $content .= $backend[3];
+                $content .= "}\n";
+                $content .= "\nsub vcl_recv {\n";
+                $content .= "\tset req.backend = backends;\n";
+                $content .= "}\n";
+            } elseif ($version == 4) {
+                $content .= "\nsub vcl_init {\n";
+                $content .= "\tnew backends = directors.round_robin();\n";
+                $content .= $backend[4];
+                $content .= "}\n";
+                $content .= "\nsub vcl_recv {\n";
+                $content .= "\tset req.backend_hint = backends.backend();\n";
+                $content .= "}\n";
+            }
+        } else if ($file == 'conf/acl.vcl') {
+            $acls = get_option($this->prefix . 'varnish_acls');
+            $acls = explode(',', $acls);
+            $content = "acl cloudflare {\n";
+            $content .= "\t# set this ip to your Railgun IP (if applicable)\n";
+            $content .= "\t# \"1.2.3.4\";\n";
+            $content .= "}\n";
+            $content .= "\nacl purge {\n";
+            $content .= "\t\"localhost\";\n";
+            $content .= "\t\"127.0.0.1\";\n";
+            foreach ($acls as $acl) {
+                $content .= "\t\"" . $acl . "\";\n";
+            }
+            $content .= "}\n";
+        } else if ($file == 'lib/purge.vcl') {
+            $purge_key = get_option($this->prefix . 'purge_key');
+            $content = str_replace('ff93c3cb929cee86901c7eefc8088e9511c005492c6502a930360c02221cf8f4', $purge_key, $content);
+        }
+        return $content;
+    }
 }
 
 $vcaching = new VCaching();

comments