code: def cache_context(self, context):
          '''
          Cache the given context to disk
          '''
          if not os.path.isdir(os.path.dirname(self.cache_path)):
              os.mkdir(os.path.dirname(self.cache_path))
          with salt.utils.files.fopen(self.cache_path, 'w+b') as cache:
              self.serial.dump(context, cachef cache_context(self, context):
          '''
          Cache the given context to disk
          '''
          if not os.path.isdir(os.path.dirname(self.cache_path)):
              os.mkdir(os.path.dirname(self.cache_path))
          with salt.utils.files.fopen(self.cache_path, 'w+b') as cache:
              self.serial.dump(context, cache)
docs: Cache the given context to disk