docs: def save_to_cache(url, response_json):
      """
      Save an HTTP response json object to the cache.
  
      If the request was sent to server via POST instead of GET, then URL should
      be a GET-style representation of request. Users should always pass
      OrderedDicts instead of dicts of parameters into request functions, so that
      the parameters stay in the same order each time, producing the same URL
      string, and thus the same hash. Otherwise the cache will eventually contain
      multiple saved responses for the same request because the URL's parameters
      appeared in a different order each time.
  
      Parameters
      ----------
      url : string
          the url of the request
      response_json : dict
          the json response
  
      Returns
      -------
      None
      """
      if settings.use_cache:
          if response_json is None:
              log('Saved nothing to cache because response_json is None')
          else:
              # create the folder on the disk if it doesn't already exist
              if not os.path.exists(settings.cache_folder):
                  os.makedirs(settings.cache_folder)
  
              # hash the url (to make filename shorter than the often extremely
              # long url)
              filename = hashlib.md5(url.encode('utf-8')).hexdigest()
              cache_path_filename = os.path.join(settings.cache_folder, os.extsep.join([filename, 'json']))
  
              # dump to json, and save to file
              json_str = make_str(json.dumps(response_json))
              with io.open(cache_path_filename, 'w', encoding='utf-8') as cache_file:
                  cache_file.write(json_str)
  
              log('Saved response to cache file "{}"'.format(cache_path_filename))