Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@amitport
Copy link

No description provided.

@haoxins
Copy link
Member

haoxins commented Feb 14, 2017

@amitport
Copy link
Author

@coderhaoxin, wouldn't conditional-get still cause the file to be read?

So although the client wouldn't wait for the server to read the file, the server will become slow when trying to process many requests in parallel

@haoxins
Copy link
Member

haoxins commented Feb 15, 2017

Personally, I have CDN for production.

/cc @jonathanong

@jonathanong
Copy link
Member

yes, I try not to serve files directly on my node.js server. they should be served via CDN.

However, I understand how the developer UX for this modular is subpar. When TJ and I were making this, I wasn't too fond of the decision to not bake the caching logic into the middleware as, as you said, it creates a file descriptor. but it does make the code simpler.

IMO it's up to the community—I don't mind baking in conditional get logic here or not. I care more that coverage dropped :)

@haoxins
Copy link
Member

haoxins commented Feb 15, 2017

@amitport can you add some tests for this ? :)

@amitport
Copy link
Author

amitport commented Feb 15, 2017

@coderhaoxin no problem, I will add this behind an optional flag and add docs+tests in a few days.

Regading CDN, IMHO, koa should provide something reasonable out-of-the-box and this is just common sense http, not some crazy optimization.

@magicdawn
Copy link

+1 on this

@haoxins haoxins self-assigned this Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants