Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide caching headers #11

Open
wmertens opened this issue Apr 10, 2012 · 3 comments
Open

Provide caching headers #11

wmertens opened this issue Apr 10, 2012 · 3 comments

Comments

@wmertens
Copy link

So the current implementation gives the client an etag which is already nice but the browser will still send out a request. Using the connect.static maxAge parameter sets the caching headers so the browser will not even send a request for the code, speeding up the connection.

https://github.com/senchalabs/connect/blob/a9f20e450b8c197e22da41d3d1d610685878489d/lib/middleware/static.js#L168

Since you're not using connect.static I think it may be enough to just add the header at

res.writeHead 200, 'OK',

but there may be some subtlety involved.

It is desirable to turn off this header while developing the client code, so some sort of option would have to be settable, but I think setting the default to at least a day is probably a good idea.

@josephg
Copy link
Owner

josephg commented Apr 11, 2012

Sounds good. Pull request?

@wenzowski
Copy link
Collaborator

It's been a while since this was opened, is it still relevant?

@josephg
Copy link
Owner

josephg commented Apr 8, 2014

I think so - but I'm not sure what the maxAge parameter should be set to. I guess it could be configurable. I won't get to this myself - its too low on my priority list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants