Replies: 2 comments 2 replies
-
|
I don't quite understand - why can you not set the |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
I believe the correct way to do this is: export const handler: Handlers = {
async GET(req, ctx) {
const x = req.headers.get('If-None-Match')
// replace this with a unique string for each page to establish a cache criteria
const id = 'deadbeef'
if (x === `W/${id}`) {
return new Response("", { status: 304 });
}
resp.headers.set("ETag", id);
return await ctx.render();
},
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently you can't cache a document because you can't change the status response using
Etag/If-None-Match, curious if there's a reason this was only done for static content and not pages?Beta Was this translation helpful? Give feedback.
All reactions