-
Notifications
You must be signed in to change notification settings - Fork 6
Response ETag Header #65
Comments
FYI, the creator of Fastify says you can increase performance in Express by disabling eTags. I'm not saying Drash shouldn't support etags, but I'd like see Drash performance be better than fastify and express; maybe that's possible on top of deno. |
Thanks for including the link! That's pretty interesting. I haven't done any benchmarking for Drash, but I'll make sure testing performance for this feature is included. |
Just to clarify on a few things, that you probably know but just showing my findings:
|
In Drash's DigitalOcean setup, the following benchmarks were received compared to Express: Express
Drash
Both frameworks seem to share the same performance. The benchmark tool tested the "Hello World!" applications of both frameworks. |
@crookse The two tests for each framework: is one for using the ETag header and one isn't? If so it is a dramatic decrease in speed :/ Though i believe Deno has the correct hashing algo's now to aid in this (which I know aren't needed) |
@ebebbington no that was just using a reverse proxy with varying number of connections. Use of the etag header should be optional via server config |
Thinking about it now.... This could probably be solved by middleware. The middleware could check if the header exists and compare the header against the response. If they match then the middleware returns a 304. Also, yes there was a decrease in speed because I deployed the applications to the smallest digital ocean server instance |
Http Cache ( |
@diveDylan I'm going to try work on this as a middleware at deno-drash-middleware when I have the chance - though I don't know if you have experience with this and wanted to write the implementation yourself inside that repo? Up to you, just thought i'd ask :) FYI going to move this issue over to the middleware repo (link above) now but will keep this issue open until it's done (unless @crookse thinks otherwise to keep this issue open) |
@ebebbington i have no experience with this, but really want to try on this O(∩_∩)O~ |
@diveDylan Aha me neither to be honest!:P So feel free! The issue is here: https://github.com/drashland/deno-drash-middleware/issues I working on other stuff atm so I wouldn’t be able to start it straight away anyways, unfortunately Just pop a comment in the issue and I’ll assign it :) |
I think this might work best as middleware? |
prolly |
@diveDylan, i'm moving this to the middleware repository. we figure this will be best as middleware so as not to bloat the deno-drash codebase |
@diveDylan, closing this since we already have an etag midldeware assigned to you in this repo. see #8 |
Summary
What: HTTP responses should send the
ETag
response header for improved caching. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag for more info.Why: Improve caching.
Acceptance Criteria
ETag
should be present in response headers.Example Pseudo Code (for implementation)
The text was updated successfully, but these errors were encountered: