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

browserify is not sending correct caching headers #48

Closed
Morriz opened this issue Jul 27, 2011 · 6 comments
Closed

browserify is not sending correct caching headers #48

Morriz opened this issue Jul 27, 2011 · 6 comments

Comments

@Morriz
Copy link

Morriz commented Jul 27, 2011

I would really love to be able to set http caching headers on the browserify response. It now has to resend every time.

Or am I missing something here?

Thanks for all the fantastic work btw!

@ghost
Copy link

ghost commented Jul 27, 2011

I put in a last-modified header but quite possibly it doesn't work:

https://github.com/substack/node-browserify/blob/master/index.js#L107

@Morriz
Copy link
Author

Morriz commented Jul 28, 2011

Your last modified is always returning the time of the request. You probably want to keep the time of bundle creation in memory, and reset it when you update the bundle (like when a file is changed and the 'watch' option is set).

Also, you are not setting the Etag header, so in essence you're not adhering to the specs I think.

Thanks again for all the work ;)


On 27Jul, 2011, at 19:22 , substack wrote:

I put in a last-modified header but quite possibly it doesn't work:

https://github.com/substack/node-browserify/blob/master/index.js#L107

Reply to this email directly or view it on GitHub:
#48 (comment)

@Morriz
Copy link
Author

Morriz commented Aug 10, 2011

Did you look into this yet? I will do it myself if I can find the time, but that won't happen soon. Maybe next week...

I am almost certain you have to return a 304 if the client asks for a cache validation.

@bminer
Copy link

bminer commented Sep 6, 2011

+1 for this. Browserify should cache the bundle, and if there are no changes to the source files, it should send 304. It should also set Last-Modified headers, etc.

@jazzzz
Copy link
Contributor

jazzzz commented Sep 11, 2012

I don't think browserify should handle the caching. A middleware or a reverse proxy handle this perfectly, all they need is the Last-Modified header.

@ghost
Copy link

ghost commented Feb 22, 2013

middleware is gone in v2

@ghost ghost closed this as completed Feb 22, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants