fix: add cache control headers and timestamp parameter to axios HEAD request in PlayListItem.vue

This commit is contained in:
Astrian Zheng 2025-05-30 11:45:15 +10:00
parent 290a9af5e1
commit 7a938bd58c
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -23,7 +23,17 @@ const emit = defineEmits<{
onMounted(async () => {
try {
await axios.head(props.item.song.sourceUrl ?? '')
//
await axios.head(props.item.song.sourceUrl ?? '', {
headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
},
params: {
_t: Date.now() //
}
})
} catch (error) {
//
const updatedSong = await apis.getSong(props.item.song.cid)