Expose cache
Simplify error bailout

No need to delete from the cache.
Add test to make sure we don't cache on error