thumbor/thumbor — pull request #337 by clifff (2014-08-20 21:25:57+00:00)
Title: Add 'purge' endpoint to force removal of stored results

Apologies in advance, this is my first real attempt at writing Python. I should also note that this PR is still in progress, but I wanted to validate the approach and get some feedback.

From time to time, our business is legally compelled to remove all traces of hosting certain content from our servers. We can delete the original assets and invalidate CDN links, but Thumbor will keep serving stored results until they expire, which is too long for our needs. To solve this, this pull request adds a new `purge` endpoint (similar to the existing `meta` one) to force the removal of a result from storage.

It accomplishes this by adding a new `remove` method to `ResultStorage`. Because file storage is based on the requesting url, there is some awkward introspection/parameter manipulation to figure out the signed path that the result we want to purge would actually live at.

Obviously this needs some tests before being mergeable, but would love some feedback on this approach and if this functionality makes sense for others.