persist cache with resource