Skip to content

Commit

Permalink
fix: 请求 updates.xml 时使用 no-cache 策略 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX authored Jul 25, 2023
1 parent 744bf21 commit 11b9187
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/sandbox/CheckVersion.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { useState, useEffect } from 'react';

async function fetchAndParseXML(): Promise<string | undefined> {
const response = await fetch('https://app.nlark.com/yuque-chrome-extension/updates.xml');
const response = await fetch(
'https://app.nlark.com/yuque-chrome-extension/updates.xml',
// 强制与 cdn 做校验是否可使用缓存内容
{ cache: 'no-cache' },
);
const xmlString = await response.text();

const parser = new DOMParser();
Expand Down

0 comments on commit 11b9187

Please sign in to comment.