1
0

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

View File

@ -438,6 +438,7 @@ export class HttpServer {
} catch (e: any) {
console.error("Error GETting file", name, e.message);
response.status = 404;
response.headers.set("Cache-Control", "no-cache");
response.body = "Not found";
}
},

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",
},
});
}
}

View File

@ -6,9 +6,6 @@ SilverBullet is implemented as an open-source, self-hosted, offline-capable web
Youve been told there is _no such thing_ as a [silver bullet](https://en.wikipedia.org/wiki/Silver_bullet). You were told wrong.
> **note** Note
> While SilverBullet has been under development for close to two years, we are still making significant changes from time to time (for the better, hopefully) that may _occasionally_ break some things. Be prepared to upgrade regularly, and while data loss has been extremely rare, keep your [[Space]] backed up! And watch [[CHANGELOG]] to see whats cooking!
## Quick links
* [[Install]]: how to install and deploy SilverBullet
* [[Manual]]: the beginnings of a user manual