Code Monkey home page Code Monkey logo

connect-etagify's People

Contributors

lloyd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

connect-etagify's Issues

Etag header very broken

I don't know if my nginx config or CloudFlare is contributing to this, but I get a strange set of headers instead of an ETag header. Using node v0.8.21 and Express 3.1.0.

HTTP/1.1 200 OK
Server: cloudflare-nginx
Date: Mon, 04 Mar 2013 05:13:06 GMT
Content-Type: application/json; charset=utf-8
0: E
1: T
2: a
3: g
X-Powered-By: Express
Cache-Control: private
...

Doesn't work on Express 3.4.x

Hi!
I'm trying to use your package but when using with express 3.4.x it is throwing an error:

TypeError: Object #<ServerResponse> has no method 'etagify' // res.etagify();

First request to etagified resource does not etagify. Second does.

$ curl -i http://localhost:5000/
HTTP/1.1 200 OK
X-Powered-By: Gerbils
Cache-Control: public, max-age=3600
Content-Type: text/html; charset=utf-8
Content-Length: 19
Connection: keep-alive

Well that's weird.
$ curl -i http://localhost:5000/
HTTP/1.1 200 OK
X-Powered-By: Gerbils
ETag: "2657ab1143a8795c9ffaec18a56f1f0c"
Cache-Control: public, max-age=3600
Content-Type: text/html; charset=utf-8
Content-Length: 19
Connection: keep-alive

Well that's weird.

Vary logic appears to be incorrect.

I'm pretty sure you're supposed to build the lookup key from the request headers specified in the Vary response header. So if the response indicated Vary: Accept-Encoding, Accept-Language you wouldn't actually store [ 'Accept-Encoding', 'Accept-Language' ] in your data structure, I think you're supposed to store the tuple of [req.path, "gzip,deflate,sdch", "en-US,en;q=0.8"] (assuming Chrome user agent used in request). And you probably need to handle Vary: * specially.

Ideally though, as mentioned in issue #1, you'd just buffer the content and calculate the ETag directly, in which case the Vary header should be irrelevant since you're not actually acting as a cache. (i.e., if issue #1 is resolved by calculating ETag every single time, this issue becomes invalid.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.