Disable 404 caching
This commit is contained in:
parent
d4d722103a
commit
a984ab1f82
@ -438,6 +438,7 @@ export class HttpServer {
|
|||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error("Error GETting file", name, e.message);
|
console.error("Error GETting file", name, e.message);
|
||||||
response.status = 404;
|
response.status = 404;
|
||||||
|
response.headers.set("Cache-Control", "no-cache");
|
||||||
response.body = "Not found";
|
response.body = "Not found";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -123,10 +123,6 @@ async function handleLocalFileRequest(
|
|||||||
request: Request,
|
request: Request,
|
||||||
pathname: string,
|
pathname: string,
|
||||||
): Promise<Response> {
|
): Promise<Response> {
|
||||||
// if (!db?.isOpen()) {
|
|
||||||
// console.log("Detected that the DB was closed, reopening");
|
|
||||||
// await db!.open();
|
|
||||||
// }
|
|
||||||
const path = decodeURIComponent(pathname.slice(1));
|
const path = decodeURIComponent(pathname.slice(1));
|
||||||
const data = await ds?.get<FileContent>([...filesContentPrefix, path]);
|
const data = await ds?.get<FileContent>([...filesContentPrefix, path]);
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -164,6 +160,9 @@ async function handleLocalFileRequest(
|
|||||||
);
|
);
|
||||||
return new Response("Not found", {
|
return new Response("Not found", {
|
||||||
status: 404,
|
status: 404,
|
||||||
|
headers: {
|
||||||
|
"Cache-Control": "no-cache",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@ SilverBullet is implemented as an open-source, self-hosted, offline-capable web
|
|||||||
|
|
||||||
You’ve been told there is _no such thing_ as a [silver bullet](https://en.wikipedia.org/wiki/Silver_bullet). You were told wrong.
|
You’ve 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 what’s cooking!
|
|
||||||
|
|
||||||
## Quick links
|
## Quick links
|
||||||
* [[Install]]: how to install and deploy SilverBullet
|
* [[Install]]: how to install and deploy SilverBullet
|
||||||
* [[Manual]]: the beginnings of a user manual
|
* [[Manual]]: the beginnings of a user manual
|
||||||
|
Loading…
Reference in New Issue
Block a user