ionrock/cachecontrol — pull request #38 by sinemetu1 (2014-08-23 20:14:28+00:00)
Title: feature - adding ability to set the amount of bytes cached

Hi @ionrock,

I'm working on a feature for http://github.com/mozilla/mozregression in which we could set the maximum bytes that we cache using cachecontrol. This PR adds this capability to the FileCache class with a `max_bytes` param. The default is 1Gb.

The implementation in this PR is using the `sys.getsizeof(value)` to take care of the byte tracking. Another approach might be to do something with [os.path.getsize() like this](http://stackoverflow.com/a/1392549/1183294) against the top cache dir.

Let me know what you think! :)