Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web show blank white page until clear Cache storage #726

Open
truonglocbinh opened this issue Jul 2, 2024 · 2 comments
Open

Web show blank white page until clear Cache storage #726

truonglocbinh opened this issue Jul 2, 2024 · 2 comments

Comments

@truonglocbinh
Copy link

I am using vue 3 and amplify AWS for deploy my vue 3 project. I had a problem that everytime I deploy new code, my web site often show blank page. If page want to show, I need clear Cache storage or wait some minutes. That's make my customer feel bad for my site. This is my config

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
import { resolve } from 'path'

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => ['ion-icon'].includes(tag),
        }
      }
    }),
    VitePWA({
      base: '/',
      includeAssets: ['img/**/*.*', 'fonts/**/*.*'],
      useCredentials: true,
      registerType: 'autoUpdate',
      manifest: {
        name: 'App',
        short_name: 'My App',
        start_url: '/',
        display: 'standalone',
        background_color: '#fff',
        theme_color: '#fff'
      }
    })
  ],
  server: {
    port: 5000,
    host: '0.0.0.0',
    hmr: {
      host: 'localhost',
      port: 5000
    }
  },
  build: {
    chunkSizeWarningLimit: 100,
    manifest: true
  },
  resolve: {
    alias: {
      '~': resolve(__dirname, 'src')
    }
  }
})

@userquin
Copy link
Member

userquin commented Jul 2, 2024

Review your cache headers, index.html should use 200, any entry inside assets folder can use immutable, check deploy docs for other deployments (AWS is missing, I dont use it)

@BrianHung
Copy link

I would also double check if you encounter maximumFileSizeToCacheInBytes, as that would prevent vendor.js from being properly cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants