Merged in fix/cache-fixes (pull request #1555)
fix/cache: reduce cachetime when null response from CS. Fix fuzzy delete * fix/cache: reduce cachetime when null response from CS. Fix fuzzy delete Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -4,10 +4,15 @@ import { cacheLogger } from "../logger"
|
||||
import { API_KEY } from "./client"
|
||||
import { getCacheEndpoint } from "./endpoints"
|
||||
|
||||
export async function deleteKey<T>(key: string) {
|
||||
export async function deleteKey<T>(key: string, opts?: { fuzzy?: boolean }) {
|
||||
const perf = performance.now()
|
||||
const endpoint = getCacheEndpoint(key)
|
||||
|
||||
const response = await fetch(getCacheEndpoint(key), {
|
||||
if (opts?.fuzzy) {
|
||||
endpoint.searchParams.set("fuzzy", "true")
|
||||
}
|
||||
|
||||
const response = await fetch(endpoint, {
|
||||
method: "DELETE",
|
||||
cache: "no-cache",
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user