Refactor CSV data loading in 'vereinsmeisterschaften.vue' and 'cms/vereinsmeisterschaften.vue' to utilize API endpoints instead of static files, addressing cache issues. Update debugging logs to reflect new data source and improve response header logging for better traceability.
This commit is contained in:
@@ -335,9 +335,9 @@ const formData = ref({
|
||||
|
||||
const loadResults = async () => {
|
||||
try {
|
||||
// Cache-Busting: Füge Timestamp hinzu, um sicherzustellen, dass wir die neueste Version laden
|
||||
// Verwende API-Endpoint statt statische Datei, um Cache-Probleme zu vermeiden
|
||||
const timestamp = new Date().getTime()
|
||||
const response = await fetch(`/data/vereinsmeisterschaften.csv?t=${timestamp}`, {
|
||||
const response = await fetch(`/api/vereinsmeisterschaften?t=${timestamp}`, {
|
||||
cache: 'no-cache',
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache'
|
||||
@@ -345,10 +345,10 @@ const loadResults = async () => {
|
||||
})
|
||||
|
||||
console.log('=== FRONTEND LOAD DEBUG ===')
|
||||
console.log('Load URL:', `/data/vereinsmeisterschaften.csv?t=${timestamp}`)
|
||||
console.log('Load URL:', `/api/vereinsmeisterschaften?t=${timestamp}`)
|
||||
console.log('Response Status:', response.status)
|
||||
console.log('Response Headers - Last-Modified:', response.headers.get('last-modified'))
|
||||
console.log('Response Headers - ETag:', response.headers.get('etag'))
|
||||
console.log('Response Headers - Content-Type:', response.headers.get('content-type'))
|
||||
console.log('Response Headers - Cache-Control:', response.headers.get('cache-control'))
|
||||
|
||||
if (!response.ok) {
|
||||
console.error('Fehler beim Laden - Response nicht OK:', response.status)
|
||||
|
||||
@@ -159,7 +159,8 @@ const selectedYear = ref('alle')
|
||||
|
||||
const loadResults = async () => {
|
||||
try {
|
||||
const response = await fetch('/data/vereinsmeisterschaften.csv')
|
||||
// Verwende API-Endpoint statt statische Datei, um Cache-Probleme zu vermeiden
|
||||
const response = await fetch('/api/vereinsmeisterschaften')
|
||||
if (!response.ok) return
|
||||
|
||||
const csv = await response.text()
|
||||
|
||||
Reference in New Issue
Block a user