Skip to content

Commit

Permalink
fix(core): avoid retrieving cached HTML #5
Browse files Browse the repository at this point in the history
  • Loading branch information
locdp committed Aug 24, 2024
1 parent 4f3cdd5 commit a38d2ca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/plugins/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ export function setupAppVersionNotification() {
}

async function getHtmlBuildTime() {
const baseURL = import.meta.env.VITE_BASE_URL

const res = await fetch(`${baseURL}index.html`)
const res = await fetch(`/index.html?time=${Date.now()}`)

const html = await res.text()

const match = html.match(/<meta name="buildTime" content="(.*)">/)
const match = html.match(/<meta name="build-time" content="([^"]*)">/)

const buildTime = match?.[1] || ''

Expand Down

0 comments on commit a38d2ca

Please sign in to comment.