Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75d86b3

Browse files
committed
Add cdn.purge_all to completely purge URLs
This command purges paths from both our local Varnish cache and (currently) from Fastly. Use this command to absolutely guarantee dropping a path from cache.
1 parent 3b2b9ca commit 75d86b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cdn.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from fabric.api import *
22

3+
from cache import purge as cache_purge
4+
35
@task
46
@runs_once
57
@roles('class-cache')
@@ -10,3 +12,11 @@ def fastly_purge(*args):
1012
for govuk_path in args:
1113
for hostname in hostnames_to_purge:
1214
run("curl -s -X PURGE -H 'Host: {0}' {1}{2}".format(hostname, govuk_fastly, govuk_path.strip()))
15+
16+
@task
17+
@runs_once
18+
@roles('class-cache')
19+
def purge_all(*args):
20+
"Purge items from Fastly and cache machines, eg \"/one,/two,/three\""
21+
cache_purge(*args)
22+
fastly_purge(*args)

0 commit comments

Comments
 (0)