Skip to main content

BrowserCache

Persistent browser-level Cache store for images.

Index

Properties

cache

cache: Cache

The opened Cache.

name

name: string

Name of the Cache bucket. Bump only if what's stored in it changes shape.

Methods

clear

  • clear(): Promise<boolean>
  • Throw the whole persistent store away and open a fresh bucket.


    Returns Promise<boolean>

    Whether there was a store to delete

fetch

  • fetch(url, options): Promise<Response>
  • Fetch an image, through the persistent store when possible.


    Parameters

    • url: string

      The URL of the image

    • optionaloptions: FetchOptions = {}

    Returns Promise<Response>

key

  • key(url): string
  • Compute the key an image URL is stored under.

    The R$VERSION directory, query string and fragment are dropped, so that the same file can be reused across versions, assuming its mtime doesn't change.


    Parameters

    • url: string

    Returns string

staticopen

Page Options