Open andrerom opened 10 years ago
personally i never used akamai so i have little experience. let me just ask a bunch of questions:
1) what would be the use case we can cover in this library? invalidating data on a cdn? anything else? 2) are there any akamai/cdn client php libraries around? what would integration of those into FOSHttpCache bring?
1) That is about it. Unsure if purging by tag can be done, so might need to keep track of urls to tags using stash for instance. 2) I couldn't find one for their Rest API which seesm to deprecate the soap api which is supported by https://github.com/stephanoff/php-akamai
if akamai has no tagging, keeping an index on the application side sounds interesting. indeed that could share a lot with https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/issues/167 . but you would need to store the akamai tag stash somewhere else than in a cache folder - you do not want to loose that information, or you won't find your resources anymore.
for 2) i think an akamai rest api should not be part of this library, that goes too far. so if you want to work on this, please check very well if there really is no such client, and then lets see if its more than 1-2 trivial calls we need and if so, start an akamai rest library in php that we can use here ;-) if its trivial calls, i can live with having them here.
you do not want to loose that information, or you won't find your resources anymore.
true, good point
2) ...
I'll pass the ball back to the customer that seemed interested in this, they might be up for contributing, or they might get in contact with Akamai about such a php rest client project.
Making sure that the added feature covers at least 2 providers and is thus not bound to a single one: Edgecast is quite popular and has APIs for purge as well. To get started, see eg: https://kb.edgewebhosting.net/KnowledgebaseArticle53812.aspx, https://www.npmjs.org/package/edgecast
And CDNetworks might make a good 3rd candidate. http://stackoverflow.com/questions/12725975/php-parse-xml-string-response-from-cdn-flush-api, https://github.com/blueboxgroup/cdnetworks-client/blob/master/README.md
I don’t have much experience with such CDN providers myself. Just checking: do they really store HTTP responses? Or are they more about storing random chunks of data? We should remember this library is about HTTP caching. :wink:
Yep, there is a risk of overdoing the scope of this bundle. SonataCacheBundle is also doing stuff with cdn's. What i totally see here is integration with some cdn library to use our mechanisms to invalidate paths, routes or tags.
But a multi-cdn client library would have to be separate or we start doing too many things in this library.
Small update here, @kmadejski did a small prototype for eZ on this and there are some good news and some bad news:
For me those two features are kind of key for FOSHttpCache, so maybe that rules out adding support for it here unless someone sees a way.
i am okay with having akamai support without the context hash in it. FOSHttpCache is also about cache tagging and invalidation of paths / banning. as long as documentation is clear what can be used and how (example config for akamai etc) i think its cool to have it.
@dbu thanks for the reply. I think I can easily share what I did, but my current schedule is extremely busy. I will try to look into that in a couple of weeks.
@kmadejski would be awesome if you can share / show it somewhere. a pull request with documentation would be very cool of course, but a blog post just explaining what you did and showing the files you did without integrating them into the repository here could be a start as well. then someone else who needs akamai support could maybe contribute the change, if you license your code accordingly.
Just to start the discussion, anyone looked into feasibility of Akamai support?
Might also be interesting to support other CDN's as well, but Akamai is typically preferred choice among media companies and they often use it already.