Skip to content

Commit 50db7b6

Browse files
yulin0629claude
andcommitted
fix: 解決 README.md 載入時的快取問題
- 在 fetch 時加入時間戳參數避免快取 - 設定 cache: 'no-cache' 確保取得最新內容 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e752ca3 commit 50db7b6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,11 @@ <h2>📚 8 個學習場景</h2>
550550
body.innerHTML = '<div class="markdown-loading">📡 載入中...</div>';
551551

552552
try {
553-
// Fetch Markdown 檔案
554-
const response = await fetch(path);
553+
// Fetch Markdown 檔案,加入防快取參數
554+
const timestamp = new Date().getTime();
555+
const response = await fetch(`${path}?t=${timestamp}`, {
556+
cache: 'no-cache'
557+
});
555558
if (!response.ok) {
556559
throw new Error('無法載入文件');
557560
}

0 commit comments

Comments
 (0)