Implemented first pass at caching. Implementation inspired by broccoli-filter.