Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.3.0. Ignores prefix on setCacheNameDetails #3372

Open
rubenaguadoc opened this issue Oct 30, 2024 · 0 comments
Open

7.3.0. Ignores prefix on setCacheNameDetails #3372

rubenaguadoc opened this issue Oct 30, 2024 · 0 comments

Comments

@rubenaguadoc
Copy link

Library Affected:
workbox-core, workbox-precaching

Browser & Platform:
All browsers

Issue or Feature Request Description:
Calling precacheAndRoute (from workbox-precaching) after calling setCacheNameDetails({ prefix: 'example' }); (from workbox-core), results in workbox ignoring the prefix and creating the workbox-precache-v2.... cache instead of example-precache-v2....

cacheNames.precache (from workbox-core) returns the correct precache name example-precache-v2... (wich does not exist, in this context)

This beahaviour was not present in 7.1.0

Example

import {
  setCacheNameDetails,
  skipWaiting,
  clientsClaim,
  cacheNames,
} from 'workbox-core';
import { precacheAndRoute } from 'workbox-precaching';

self.__WB_DISABLE_DEV_LOGS = true;

setCacheNameDetails({ prefix: 'my-app' });
skipWaiting();
clientsClaim();

precacheAndRoute([].concat(self.__WB_MANIFEST || []));
// Creates 'workbox-precache-v2...'

self.addEventListener('activate', (event) => {
    console.log(cacheNames.precache);
    // Yields 'my-app-precache-v2...'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant