angular/angular.js — pull request #7448 by orlando (2014-05-13 17:21:06+00:00)
Title: adding enable/disable to cacheFactory

This functionality to `$cacheFactory` instances, allow us to disable/enable the cache programatically.

```
cache = $cacheFactory('test');
cache.put('foo', 'bar');

cache.disable();

cache.get('foo') => undefined
```

My use case is that I want to cache everything, and then I send SSE to notify clients about changes and expire cache for certain Resources (this is handled by another class).

In case the client can not receive events (connection problems with the socket), then I want to disable cache, and later when the connection is restored, enable it again.

I think a enable/disable method in the `$cacheFactory` class will be a good idea, if you guys considerer this approach can be merged, then I'll implement the class method to enable/disable all the cache instances with one method call.