canina/public/sw.js
parsa aghayi c95c9e5ce0 feat: initialize project structure
- Configure project metadata and dependencies
- Setup Vite with React and TypeScript
- Add environment configuration and .gitignore
- Implement initial application entry point and assets
2026-05-26 11:37:22 +03:30

24 lines
477 B
JavaScript

const CACHE_NAME = 'canina-v1';
const ASSETS_TO_CACHE = [
'/',
'/index.html',
'/src/main.tsx',
'/src/index.css'
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(ASSETS_TO_CACHE);
})
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((response) => {
return response || fetch(event.request);
})
);
});