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

Skip to content

Commit 60997bd

Browse files
committed
Merge pull request alphagov#48 from alphagov/cdn-purge
Add a task to purge from Fastly
2 parents 8aec8f6 + 7ced356 commit 60997bd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

cdn.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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())

fabfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import apt
1717
import cache
1818
import campaigns
19+
import cdn
1920
import es
2021
import incident
2122
import licensify

0 commit comments

Comments
 (0)