Added class caching

but there seems to a mistake in the cookbook using caching inside a
class seems to work fine which is contradicting