Disable 404 caching

This commit is contained in:
Zef Hemel
2023-11-17 13:54:48 +01:00
parent d4d722103a
commit a984ab1f82
3 changed files with 4 additions and 7 deletions
+3 -4
View File
@@ -123,10 +123,6 @@ async function handleLocalFileRequest(
request: Request,
pathname: string,
): Promise<Response> {
// if (!db?.isOpen()) {
// console.log("Detected that the DB was closed, reopening");
// await db!.open();
// }
const path = decodeURIComponent(pathname.slice(1));
const data = await ds?.get<FileContent>([...filesContentPrefix, path]);
if (data) {
@@ -164,6 +160,9 @@ async function handleLocalFileRequest(
);
return new Response("Not found", {
status: 404,
headers: {
"Cache-Control": "no-cache",
},
});
}
}