test cache functionality