[enh] added saving of cache periodically