mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
fix(admin-api): bypass browser cache locks for live requests
Use no-store on both client requests and admin responses. Personalized live data must not be reused, and one stalled same-URL cache entry must not block later log requests behind the browser cache lock.
This commit is contained in:
1 parent
6cdcedde92
commit
82206b066a
3 files changed
+27
-1
No files matched your search
@@ -15,6 +15,10 @@ export function useAuthState() {
|
||||
export async function apiFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const res = await fetch(path, {
|
||||
credentials: "same-origin",
|
||||
// Live data, never from the browser cache. This also keeps requests out of
|
||||
// its per-URL cache lock: otherwise one request that never answers makes
|
||||
// every later request for the same URL wait up to 20 s behind it.
|
||||
cache: "no-store",
|
||||
...init,
|
||||
// JSON in/out: h3's readBody only parses JSON bodies when the request
|
||||
// declares application/json, and the browser defaults string bodies to
|
||||
|
||||
Reference in new issue
Block a user