tiny bug in cache invalidation calculation