docs: def _clear(self, fully=True):
          """Delete all but first page from cache. Set keyframe to first page."""
          pages = self.pages
          if not pages:
              return
          self._keyframe = pages[0]
          if fully:
              # delete all but first TiffPage/TiffFrame
              for i, page in enumerate(pages[1:]):
                  if not isinstance(page, inttypes) and page.offset is not None:
                      pages[i+1] = page.offset
          elif TiffFrame is not TiffPage:
              # delete only TiffFrames
              for i, page in enumerate(pages):
                  if isinstance(page, TiffFrame) and page.offset is not None:
                      pages[i] = page.offset
          self._cached = False