数据链路 P1 修复:ETag 缓存 + 校准漂移检测
P1-5 ETag 支持: - 后端新增 _etag_middleware:GET /api/* 自动返回 ETag (MD5) - 支持 If-None-Match 请求头,匹配时返回 304 + 30s Cache-Control - 前端 cache: no-store → default,浏览器自动处理 ETag/304 节省带宽 P1-6 校准漂移检测: - probability_calibration.py 新增 check_calibration_drift() - 对比最近 200 条 daily_records 的 CRPS 与校准基线 - 漂移 >15% 时返回 warning 提示重新训练 - 集成到 /api/system/status 的 probability.drift 字段 Tested: python -m ruff check ., npx tsc --noEmit
This commit is contained in:
@@ -68,7 +68,7 @@ async function fetchJson<T>(url: string, options?: { timeoutMs?: number }): Prom
|
||||
try {
|
||||
response = await fetchBackendApi(url, {
|
||||
headers,
|
||||
cache: "no-store",
|
||||
cache: "default",
|
||||
signal: controller?.signal,
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -238,7 +238,7 @@ export const dashboardClient = {
|
||||
void fetch(`/api/system/priority-warm?${params.toString()}`, {
|
||||
method: "POST",
|
||||
headers: { Accept: "application/json" },
|
||||
cache: "no-store",
|
||||
cache: "default",
|
||||
keepalive: true,
|
||||
}).catch(() => {});
|
||||
},
|
||||
@@ -418,7 +418,7 @@ export const dashboardClient = {
|
||||
}).then((headers) => fetchBackendApi("/api/scan/terminal/ai", {
|
||||
method: "POST",
|
||||
headers,
|
||||
cache: "no-store",
|
||||
cache: "default",
|
||||
body: JSON.stringify({
|
||||
filters: payload.filters,
|
||||
snapshot_id: snapshotId || null,
|
||||
|
||||
Reference in New Issue
Block a user