Could you please sync the etag algorithm with nginx.
allex opened this issue · 3 comments
allex commented
https://serverfault.com/questions/690341/algorithm-behind-nginx-etag-generation
1828
1829 etag->value.len = ngx_sprintf(etag->value.data, "\"%xT-%xO\"",
1830 r->headers_out.last_modified_time,
1831 r->headers_out.content_length_n)
1832 - etag->value.data;
1833
1834 r->headers_out.etag = etag;
1835
1836 return NGX_OK;
dougwilson commented
The goal of this module is not to mimic nginx, so there isn't any desire to do this. If you want to see it happen, can you please explain the case and perhaps even share code in some language that we can read (i.e. JavaScript)?
allex commented
please see pr #23, for details. actually make the weak etag same with ng default output, in that case we can cache the first request when use nginx upstream a node server with etag.
dougwilson commented
Thanks for the pull request! I left some feedback, but I just found there is already a solution for this on npm: use the following module: https://www.npmjs.com/package/nginx-etag