We have developed an extension which allows purging of Fastly. Unfortunately in the function invalidate($invalidations) there is a call to getDomain() which returns a domain for the current object. Some of these domains will be in the form of 'wfmcomdev2.prod.acquia-sites.com'.
What would the best plan be to skip those domains? I currently have a very ugly hack - see below
//Special handling for acquia domains.
if (strpos($request->_host, "acquia-sites.com")) {
$request->_invalidation->setStatusSucceeded();
$request->result = TRUE;
}
Any suggestions on how to do this better? I see the domains are build in acquia_purge/lib/AcquiaPurgeHostingInfo.php.
thanks
Selwyn
Comments
Comment #5
nielsvm commentedHey Selwyn,
Thank you for filing this!!!
Initially I was really surprised seeing your bug report, since I thought that the
acquia-sites.comdomain shouldn't ever popup in the domain detection. So I made the first commit you see hereabove, to then later realize that this isn't entirely true. Sometimes, people have the AP module installed on a dev/stage environment without ANY domain names configured to it, or alternatively, on a production environment where theacquia-sites.comdomain is the primary origin domain for a CDN sitting in front of it.So I rolled back my first commit and then made the second commit. The changes pushed now assure that the
acquia-sites.comdomain is really ONLY present when there's absolutely no other domain name manually/automatically configured.So this means, that with the recent commits, you can STILL encounter such domain name. However, when you now encounter it, there's likely no invalidation objects getting offered for other domains, which means you'll need to implement some other strategy for purging those URLs at Fastly.
...and that last scenario, is a bit too Fastly-specific for me to answer :-)