The CCU API that this module currently does not support wildcard clearing, but the ECCU API does. It also has a SOAP interface (although quite different), so it's worth supporting IMO.

The current implementation adds support somewhat transparently by looking for a "*" in any of the paths, and if so, using the new AkamaiEnhancedCacheControlClient class instead. I'm not crazy about the way the patterns are translated into XML, but I'm not sure of a better way considering SimpleXML's lack of namespace support. I also had to do some goofyness when downloading the wsdl since for some reason the ECCU wsdl is behind basic auth and php is dumb.

Attached patch is still a bit rough, but I think it's 90% there. Will post a followup soon once I can test it a bit more.

Comments

febbraro’s picture

Cool, I think this is good to support, that WSDL thing is so bogus :\ Do they support a REST API? or SOAP only?

As an aside, think we want to configure which API to use (on the config screen specify CCU or ECCU) or just do the smart recognition as you already are?

msonnabaum’s picture

Unfortunately it's SOAP only. I'm actually still having trouble with this, but working with akamai support to figure it out. Will post back again once I can confirm this is working.

I'm starting to think it's not worth it to try to be smart and maybe it should just be an option. Now that I've been digging into cachetags and using it with reverse proxy caches, I'm realizing there's a use case for invalidating based on other headers, which ECCU can do. For example, he's how I implemented it for purge: http://drupal.org/node/1394462.

msonnabaum’s picture

StatusFileSize
new957 bytes
new8.02 KB

Here's a simpler version that's more flexible, but doesn't add anything else to the UI except the new end point url on the admin page. The only way to use the ECCU class is to call it directly, which I think is useful enough for other modules that we could just start it there. There are so many options in that API, and most of them are so edge case that I dont know if it's worth it to even try to put a UI in front of it.

So far the class can clear based on recursive path patterns and response headers. There are a few more options that could be implemented, but I figure they can be added as needed. I don't see all of them being useful in the case of Drupal, but I did it in such a way that they could be easily added later.

Also attached a cachetags backend as an example of how it could be used. Once the cachetags implementation starts to solidify, I'll submit a proper patch for it.

pwolanin’s picture

Is the WSDL common or somehow customized per akamai account? Seems odd indeed that it's behind auth.

Also, why not allow me to specify a path instead of a URL? If I've already downloaded the WSDL (and e.g. added it to my codebase), doesn't seem like I'd need to have the module downloading it again?

pwolanin’s picture

Status: Needs review » Needs work

If the name of the variable for the CCU WDSL path is changing, there needs to be an update function.

febbraro’s picture

The WSDL is not specific per account, but it is not a commonly published URL. Akamai tries to keep it under wraps, so I could not publish it with the module (probably not a good idea either) In any case, the WSDL is a URI, but the SoapLibrary will (by default) cache it in the /tmp for 24 hours (the ttl and location are configurable), so it is really not making the WSDL request on each and every invocation. The URI is simply delegated directly to the SoapClient class, so if it supports local file URIs, then it should all work like magic.

Does that address your concerns?

msonnabaum’s picture

I think Peter was concerned because I have to bypass the default php handling of the wsdl cache because it's behind basic auth. Still, the patch only redownloads if it doesn't exist, so I dont see that as a problem.

msonnabaum’s picture

Status: Needs work » Needs review
StatusFileSize
new8.62 KB

New patch with an update function for the variable name change.

pwolanin’s picture

Status: Needs review » Needs work

We should never be downloading the WSDL. Put it on local disk with a setting to find it.

  // This caches the WSDL in memory only.
  ini_set('soap.wsdl_cache', '2');
msonnabaum’s picture

Status: Needs work » Needs review

So we may not actually end up using this, because apparently, the ECCU api can take 20-40 minutes to propagate (vs 10 for CCU). That said, this patch worked fine for me when I tested it, and still might be useful to have even if it's not exposed in the UI.

The wsdl downloading is really a totally separate issue considering the CCU support already uses php's default behavior. If that's something we want to change, we should start a new issue. No sense in blocking this patch with it.

barrett’s picture

Issue summary: View changes
Status: Needs review » Postponed

Since Akamai is sunsetting their CCU SOAP interface, I have a feeling this ECCU interface is being sunset as well. I've reached out to them for clarification.

heddn’s picture

Status: Postponed » Closed (won't fix)

Marking this closed, since the SOAP interface has gone away.

barrett’s picture

Status: Closed (won't fix) » Postponed

Actually, the SOAP interface has been removed from the module because the module is aimed at the CCU API, but we could re-add SOAP support to take advantage of the ECCU API.

Re-setting this to Postponed. I'm not averse to supporting the ECCU API, but its not priority at this point.

damienmckenna’s picture

Does the new v3 API support wildcard flushing?

damienmckenna’s picture

Title: Support the ECCU API for wildcard cache clears » Support wildcard cache clears
Version: 7.x-1.3 » 7.x-3.x-dev
Status: Postponed » Needs work

Lets re-enable this.

There are lots of scenarios where wildcard paths should be supported automatically, e.g. when there's a pager, when a Panels page's path includes arguments, etc.

damienmckenna’s picture

For sites that use Expire, they pass in a list of paths to clear and another list that indicates which of the first list should be wildcard flushes, it is up to the receiving module how to handle these. Currently the Akamai module just throws this extra information away and just processes the list of (internal) paths.

damienmckenna’s picture

I've opened #2822616: Improve integration with hook_expire_cache to look to expanding support for the full hook_expire_cache() API, this would be a key part of it.

damienmckenna’s picture

A slightly more.. silly.. approach would be to store all of the paths that need to be cleared and use logic in Drupal to push all of these paths through to Akamai. That would also result in faster cache clearing (Fast Purge vs ECCU).. but would mean storing a lot of data.

elijah lynn’s picture

Wildcard purge for v3 is coming but not yet available in Akamai yet. They are working on it and it was estimated to be Q4/Q1 a few months ago.

damienmckenna’s picture

@Elijah Lynn: That's excellent news! Do you happen to have a link on where that may have been mentioned?

elijah lynn’s picture

It was internally from Akamai. Do you have access to an Akamai rep to request an updated timeline? I can ask if you don't.

WidgetsBurritos’s picture

Status: Needs work » Postponed