We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89a68cd commit 179ec72Copy full SHA for 179ec72
astro.config.mjs
@@ -153,7 +153,27 @@ export default defineConfig({
153
mdx(),
154
svelte(),
155
serviceWorker({
156
- workbox: { inlineWorkboxRuntime: true },
+ workbox: {
157
+ inlineWorkboxRuntime: true,
158
+ runtimeCaching: [
159
+ {
160
+ urlPattern:
161
+ /\.(?:js|css|json|png|jpg|jpeg|svg|woff2?|ttf|eot|gif)$/,
162
+ handler: "CacheFirst",
163
+ options: {
164
+ cacheName: "assets-cache",
165
+ expiration: {
166
+ maxEntries: 100,
167
+ maxAgeSeconds: 60 * 60 * 1, // 1h
168
+ },
169
170
171
172
+ urlPattern: /\.html$/,
173
+ handler: "NetworkOnly", // ⛔ Don't cache HTML
174
175
+ ],
176
177
}),
178
...(fastBuild
179
? []
0 commit comments