Skip to content

Commit

Permalink
fix: temp remove workbox
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalCodes committed Apr 22, 2024
1 parent f6a7df8 commit a561e82
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,67 +75,67 @@ export default defineConfig({
},
],
},
workbox: {
cleanupOutdatedCaches: true,
skipWaiting: true,
clientsClaim: true,
// workbox: {
// cleanupOutdatedCaches: true,
// skipWaiting: true,
// clientsClaim: true,

runtimeCaching: [
{
// Caches Google Fonts with a Cache First strategy.
urlPattern: new RegExp(
"^https://fonts.(?:googleapis|gstatic).com/(.*)",
),
handler: "CacheFirst",
options: {
cacheName: "google-fonts",
expiration: {
maxEntries: 30,
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
// Caches images with a Cache First strategy.
urlPattern: /\.(?:png|gif|jpg|jpeg|svg|webp)$/,
handler: "CacheFirst",
options: {
cacheName: "images",
expiration: {
maxEntries: 60,
},
},
},
{
urlPattern: new RegExp("^https://api.ngoworld.org/(.*)"),
handler: "StaleWhileRevalidate",
options: {
cacheName: "api",
expiration: {
maxAgeSeconds: 86400,
},
cacheableResponse: {
statuses: [0, 200, 201],
},
},
},
{
urlPattern: new RegExp("^http://localhost:5000/(.*)"),
handler: "StaleWhileRevalidate",
options: {
cacheName: "api-dev",
expiration: {
maxAgeSeconds: 86400,
},
cacheableResponse: {
statuses: [0, 200, 201],
},
},
},
],
},
// runtimeCaching: [
// {
// // Caches Google Fonts with a Cache First strategy.
// urlPattern: new RegExp(
// "^https://fonts.(?:googleapis|gstatic).com/(.*)",
// ),
// handler: "CacheFirst",
// options: {
// cacheName: "google-fonts",
// expiration: {
// maxEntries: 30,
// },
// cacheableResponse: {
// statuses: [0, 200],
// },
// },
// },
// {
// // Caches images with a Cache First strategy.
// urlPattern: /\.(?:png|gif|jpg|jpeg|svg|webp)$/,
// handler: "CacheFirst",
// options: {
// cacheName: "images",
// expiration: {
// maxEntries: 60,
// },
// },
// },
// {
// urlPattern: new RegExp("^https://api.ngoworld.org/(.*)"),
// handler: "StaleWhileRevalidate",
// options: {
// cacheName: "api",
// expiration: {
// maxAgeSeconds: 86400,
// },
// cacheableResponse: {
// statuses: [0, 200, 201],
// },
// },
// },
// {
// urlPattern: new RegExp("^http://localhost:5000/(.*)"),
// handler: "StaleWhileRevalidate",
// options: {
// cacheName: "api-dev",
// expiration: {
// maxAgeSeconds: 86400,
// },
// cacheableResponse: {
// statuses: [0, 200, 201],
// },
// },
// },
// ],
// },
}),
],
server: {
Expand Down

0 comments on commit a561e82

Please sign in to comment.