Add tests on cache invalidation