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

selwynpolit created an issue. See original summary.

  • nielsvm committed 9bdd580 on 7.x-1.x
    Issue #2894021: *.acquia-sites.com domain got detected when there was...

  • nielsvm committed ead6ee4 on 7.x-1.x
    Issue #2894021 by nielsvm: When extending purging to fastly, domains...

nielsvm credited nielsvm.

nielsvm’s picture

Status: Active » Fixed

Hey Selwyn,

Thank you for filing this!!!

Initially I was really surprised seeing your bug report, since I thought that the acquia-sites.com domain 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 the acquia-sites.com domain 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.com domain 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 :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.