deno-embedder icon indicating copy to clipboard operation
deno-embedder copied to clipboard

Feature: Add ETag support

Open NfNitLoop opened this issue 2 years ago • 2 comments

This is a feature I requested and used in rust-embed: https://github.com/pyrossh/rust-embed/issues/140

Would be nice to have it here too.

  • [ ] Update the generator to save LastModified
  • [ ] Update the generator (or just ad a lazy method) to provide a sha-256 hash of the bytes.
  • [ ] Update the oak helpers to properly serve requests w.r.t. Tag/Last-Modified

NfNitLoop avatar Feb 14 '23 03:02 NfNitLoop

Not sure how I should handle LastModified for the ESBuilder plugin. I guess we could always just emit the current date, but might result in lots of spurious updates to that line in the file.

OTOH, I suppose if we cared about clean Git history we wouldn't be constantly checking in bundles of our code. 🤪

NfNitLoop avatar Feb 14 '23 03:02 NfNitLoop

I would love to get support for this.

I'm exploring using jsr has a way to publish websites / apps: https://dash.deno.com/playground/val-town-docs

image

You can even run these websites locally:

deno serve jsr:@pomdtr/[email protected]

Currently I use some very basic cache-control:

https://jsr.io/@pomdtr/val-town-docs/0.0.4/mod.ts#L24

But i would prefer to use Last-Modified headers.

pomdtr avatar Jun 22 '24 07:06 pomdtr