export declare function cacheFirstFetch(request: Request): Promise; export declare function networkFirstFetch(request: Request): Promise; /** Fetch the directory index without serving upstream HTML or headers on the app origin. */ export declare function fetchBlueprintsIndex(): Promise; /** * For offline mode to work we need to cache all required assets. * * These assets are listed in the `/assets-required-for-offline-mode.json` * file and contain JavaScript, CSS, and other assets required to load the * site without making any network requests. */ export declare function cacheOfflineModeAssetsForCurrentRelease(excludedAssets?: readonly string[]): Promise; /** * Remove outdated files from the cache. * * We cache data based on `buildVersion` which is updated whenever Playground * is built. So when a new version of Playground is deployed, the service * worker will remove the old cache and cache the new assets. * * If your build version doesn't change while developing locally check * `buildVersionPlugin` for more details on how it's generated. */ export declare function purgeEverythingFromPreviousRelease(): Promise; /** * Answers whether a given URL has a response in the offline mode cache. * Ignores the search part of the URL by default. */ export declare function hasCachedResponse(url: string, queryOptions?: CacheQueryOptions): Promise; export declare function putCachedResponse(request: RequestInfo, response: Response): Promise; /** * Decide whether this worker may use Playground's CacheStorage for a URL. * * Only the app-origin worker may use CacheStorage for shared platform downloads. * WordPress code can open and change any cache on the WordPress origin, including * Playground's cache. Giving the cache a special name does not protect it. * * For example, a plugin could store a fake response under the cache key * https://playground.wordpress.net/wp-6.9/wordpress-static.zip. Without the origin * guard, the archive shortcut below would allow the WordPress worker to reuse * those attacker-written bytes as a WordPress download. The app hostname in the * key does not protect the entry: the cache still belongs to the WordPress origin. * * Reject WordPress-origin CacheStorage before checking the requested URL. The app * can still cache its own shared downloads, and WordPress-side fetches can use the * browser HTTP cache. This rule does not disable HTTP caching or require a separate * copy of every download for each Playground. * * On the app origin, the WordPress static-archive shortcut is checked first. * For other URLs, exclude live scoped responses, PHP endpoints, and Vite * development assets. The final origin check also rejects other ports, which * may serve a live site's responses rather than reusable platform files. */ export declare function shouldCacheUrl(url: URL): boolean; export declare function isCurrentServiceWorkerActive(): boolean;