Check for available space before writing cache