diff --git a/src/fetch.ts b/src/fetch.ts index 827670e..72c6fe8 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -62,7 +62,9 @@ export function contextFetch(context: Context, options: ContextFetchOptions) { // cache bypass so we dont have CORS issues with cached images // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache if (bypassingCache) { - url += (/\?/.test(url) ? '&' : '?') + new Date().getTime() + if (bypassingCache instanceof RegExp && bypassingCache.test(url)) { + url += (/\?/.test(url) ? '&' : '?') + new Date().getTime() + } } const baseFetchOptions: BaseFetchOptions = { diff --git a/src/options.ts b/src/options.ts index b11bdc6..8df9e27 100644 --- a/src/options.ts +++ b/src/options.ts @@ -88,7 +88,7 @@ export interface Options { * * default: false */ - bypassingCache?: boolean + bypassingCache?: boolean | RegExp /** * A data URL for a placeholder image that will be used when fetching