We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f44435e + 38ae7cb commit 32f06f6Copy full SHA for 32f06f6
cdn.py
@@ -1,10 +1,12 @@
1
from fabric.api import *
2
-import cache
3
4
@task
5
@runs_once
6
@roles('class-cache')
7
def fastly_purge(*args):
8
"Purge items from Fastly, eg \"/one,/two,/three\""
9
- for path in args:
10
- run("curl -s -X PURGE -H 'Host: www.gov.uk' http://www-gov-uk.map.fastly.net%s" % path.strip())
+ govuk_fastly = 'http://www-gov-uk.map.fastly.net'
+ hostnames_to_purge = ['www.gov.uk', 'assets.digital.cabinet-office.gov.uk']
+ for govuk_path in args:
11
+ for hostname in hostnames_to_purge:
12
+ run("curl -s -X PURGE -H 'Host: {0}' {1}{2}".format(hostname, govuk_fastly, govuk_path.strip()))
0 commit comments