From 3989da2f3230821375ec458e81e26b3a6db8ce3c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 8 Dec 2018 20:37:35 +0000 Subject: [PATCH] purge: Fix CDN purge script (enable `purgeAllDynamic` option) While not yet documented or announced, it seems the Purge API from StackPath/Highwinds/StrikeTracker no longer purges variants by default as of last month. The old behaviour can be regained through the undocumented `purgeAllDynamic` boolean option which appears to be false by default. I'm not sure what variants we have that cause this behaviour, but it might be due to something like Vary:Accepted-Encoding (gzip etc.). Fixes #45. --- purge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/purge.php b/purge.php index 49feee57..37e3f29c 100644 --- a/purge.php +++ b/purge.php @@ -37,7 +37,7 @@ // The StrikeTracker Purge API is protocol-sensitive. // HTTP and HTTPS need to be purged separately, or -// we can use a protocol-relative file url, which HW +// we can use a protocol-relative file url, which Highwinds // supports as short-cut for purging both. $file = "//{$hwConfig->file_hostname}/" . ltrim( $_SERVER[ 'REQUEST_URI' ], '/' ); @@ -73,10 +73,10 @@ function jq_request_post_json( $url, array $headers, array $postData ) { "Authorization: Bearer {$hwConfig->api_token}", "Content-Type: application/json", ), - // post body (JSON) + // post body (will be encoded as JSON) array( 'list' => array( - array( 'url' => $file ), + array( 'url' => $file, 'purgeAllDynamic' => true ), ), ) );