count: Take attributes into account when building the cache key.