mrappleton/backbone-fetch-cache — pull request #20 by mrappleton (2013-05-03 18:32:06+00:00)
Title: Clear on save

Addresses https://github.com/mrappleton/backbone-fetch-cache/issues/16.

Adds a decorator around `Backbone.Model.prototype.save` which tries to delete all of:

```JS
model.url;
model.url();
model.collection.url;
model.collection.url();
```
...before returning the result of calling the original save method.

Also adds a public method, `Backbone.fetchCache.clearItem` which allows a manual flush of any cache key.

@mzafer what do you think of this? I wonder if maybe it should wrap around `Model.prototype.sync` instead as that is lower level and also a documented way to alter model state?