hi there so i have a link lets say it is https://example.com/exp the exp page is my add page and it is cached in my service worker and works offline now when i open my list and choose to edit a record it opens in https://example.com/exp?id=2 when i open this page it doesn't work offline if i remove the id part then it works but then it is an add i want my edit page to be offline as-well how do i fix this?
please help
my code**
// give your cache a name
const cacheName = 'my-cache';
// alert('hi')
// put the static assets and routes you want to cache here
const filesToCache = [
'/',
'https://example.com/exp',
];
// the event handler for the activate event
self.addEventListener('activate', e => self.clients.claim());
// the event handler for the install event
// typically used to cache assets
self.addEventListener('install', e => {
e.waitUntil(
caches.open(cacheName)
.then(cache => cache.addAll(filesToCache))
);
});
// the fetch event handler, to intercept requests and serve all
// static assets from the cache
self.addEventListener('fetch', e => {
e.respondWith(
caches.match(e.request)
.then(response => response ? response : fetch(e.request))
)
});