docs: def cache_url_data(self, url, data, attempt=0):
          """ cache the data retrieved from ensembl
          
          Args:
              url: URL for the Ensembl REST service
              data: response data from Ensembl
          """
          
          if attempt > 5:
              raise ValueError('too many attempts at writing to the cache')
          
          key = self.get_key_from_url(url)
          
          # don't cache the ensembl version check
          if key == "info.rest":
              return
          
          current_date = datetime.strftime(self.today, "%Y-%m-%d")
          
          # python3 zlib requires encoded strings
          if IS_PYTHON3:
              data = data.encode("utf-8")
          
          compressed = zlib.compress(data)
          
          # python2 sqlite3 can't write "8-bit bytestrings", but it can handle
          # buffer versions of the bytestrings
          if IS_PYTHON2:
              compressed = buffer(compressed)
          
          t = (key, self.genome_build, current_date, self.api_version, compressed)
          
          cmd = "INSERT OR REPLACE INTO ensembl " \
              "(key, genome_build, cache_date, api_version, data) VALUES (?,?,?,?,?)"
          try:
              with self.conn as cursor:
                  cursor.execute(cmd, t)
          except sqlite3.OperationalError:
              # if we hit a sqlite locking error, wait a random time so conflicting
              # instances are less likely to reconflict, then retry
              time.sleep(random.uniform(1, 10))
              self.cache_url_data(url, data.decode('utf-8'), attempt + 1)