
- Flatten directory structure by moving files from astro-church-website/ to root - Remove church-core subdirectory in favor of inline Rust library - Update .gitignore to properly exclude build artifacts, generated files, and dependencies - Add environment variables, IDE files, and coverage reports to gitignore - Include generated CSS files and native bindings in ignore patterns
43 lines
888 B
JavaScript
43 lines
888 B
JavaScript
const CACHE_NAME = 'rtsda-church-v1';
|
|
const urlsToCache = [
|
|
'/',
|
|
'/about',
|
|
'/contact',
|
|
'/sermons',
|
|
'/events',
|
|
'/live',
|
|
'/manifest.json'
|
|
];
|
|
|
|
self.addEventListener('install', (event) => {
|
|
event.waitUntil(
|
|
caches.open(CACHE_NAME)
|
|
.then((cache) => {
|
|
return cache.addAll(urlsToCache);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener('fetch', (event) => {
|
|
event.respondWith(
|
|
caches.match(event.request)
|
|
.then((response) => {
|
|
// Return cached version or fetch from network
|
|
return response || fetch(event.request);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener('activate', (event) => {
|
|
event.waitUntil(
|
|
caches.keys().then((cacheNames) => {
|
|
return Promise.all(
|
|
cacheNames.map((cacheName) => {
|
|
if (cacheName !== CACHE_NAME) {
|
|
return caches.delete(cacheName);
|
|
}
|
|
})
|
|
);
|
|
})
|
|
);
|
|
}); |