code: def store_archiver_index(config, archiver, index):
      
      root = pathlib.Path(config.cache_path) / archiver.name
  
      if not root.exists():
          root.mkdir()
          logger.debug("Created archiver directory")
  
      index = sorted(index, key=lambda k: k["date"], reverse=True)
  
      filename = root / "index.json"
      with open(filename, "w") as out:
          out.write(json.dumps(index, indent=2))
      logger.debug(f"Created index output")
      return filename
docs: Store an archiver's index record for faster search.
  
      :param config: The configuration
      :type  config: :class:`wily.config.WilyConfig`
  
      :param archiver: The name of the archiver type (e.g. 'git')
      :type  archiver: ``str``
      
      :param index: The archiver index record
      :type  index: ``dict``
  
      :rtype: `pathlib.Path`