Browse Source

设置新的缓存策略

1
mo 1 year ago
parent
commit
765b0b3911
2 changed files with 11 additions and 18 deletions
  1. 1 1
      src/views/login/index.tsx
  2. 10 17
      vite.config.ts

+ 1 - 1
src/views/login/index.tsx

@@ -135,7 +135,7 @@ export default defineComponent({
         </div>
         <div class={styles['view-account-form']}>
           <img class={styles.colLogo} src={colLogo}></img>
-          1111111111111
+          1122222
           {isForgot.value ? (
             <NTabs
               key="forgotPassword"

+ 10 - 17
vite.config.ts

@@ -63,23 +63,16 @@ export default defineConfig({
       registerType: 'autoUpdate',
       includeAssets: ['./logo.png'],
       workbox: {
-        globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
-        runtimeCaching: [
-          {
-            urlPattern: /(.*?)\.(js|css|ts)/, // js /css /ts静态资源缓存
-            handler: 'NetworkOnly',
-            options: {
-              cacheName: 'js-css-cache'
-            }
-          },
-          {
-            urlPattern: /(.*?)\.(png|jpe?g|svg|gif|bmp|psd|tiff|tga|eps|html)/, // 图片缓存
-            handler: 'NetworkOnly',
-            options: {
-              cacheName: 'image-cache'
-            }
-          }
-        ]
+        globIgnores: ['**/*.{js,css,html,ico,png,svg}']
+        // runtimeCaching: [
+        //   {
+        //     urlPattern: /(.*?)\.(js|css|ts)/, // js /css /ts静态资源缓存
+        //     handler: 'NetworkOnly',
+        //     options: {
+        //       cacheName: 'js-css-cache'
+        //     }
+        //   }
+        // ]
       },
       manifest: {
         name: '酷乐秀-音乐数字课堂',