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

Add reading encoded file from disk if present #270

Merged
merged 1 commit into from Jul 26, 2013

Conversation

Projects
None yet
2 participants
@jkm
Contributor

jkm commented Jul 26, 2013

This commit adds the ability to send compressed files if present
instead of compressing the file on each request.

To test it out

$ cd examples/http_static_server/
$ dub --build=release
$ ab -H "Accept-Encoding: gzip, deflate" -r -n 10000 -c 100 http://localhost:8080/index_large.html
[snip]
$ ab -H "Accept-Encoding: gzip, deflate" -r -n 10000 -c 100 http://localhost:8080/gzip/index_large.html
[snip]

This fixes part of #143. I'd like to see the needed change for libevent. I'm curious what's the impact on performance. Is somebody working on it?
BTW do you have some performance numbers for vibe.d handling static files. I only get about 10MB per second. Must be doing something wrong.

Add reading encoded file from disk if present
This commit adds the ability to send pre compressed files if present
instead of compressing the file on each request.
@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Jul 26, 2013

Member

Thanks! I meant to implement that for a while now, good to have that available now.

Regarding the libevent2 issue, if you have some time to look at this it would be great. I currently have so much stuff that has higher priority that I won't get to it in the near future. The (wrong) code is in libevent2_tcp.d line 267 and following. For some reason it crashes and I couldn't find sufficient documentation or a working example to compare against. Maybe evbuffer_add_file needs to be given a dedicated buffer or something along those lines.

Member

s-ludwig commented Jul 26, 2013

Thanks! I meant to implement that for a while now, good to have that available now.

Regarding the libevent2 issue, if you have some time to look at this it would be great. I currently have so much stuff that has higher priority that I won't get to it in the near future. The (wrong) code is in libevent2_tcp.d line 267 and following. For some reason it crashes and I couldn't find sufficient documentation or a working example to compare against. Maybe evbuffer_add_file needs to be given a dedicated buffer or something along those lines.

s-ludwig added a commit that referenced this pull request Jul 26, 2013

Merge pull request #270 from jkm/use_encoded_file
Add reading encoded file from disk if present. See #143.

@s-ludwig s-ludwig merged commit a8f66b1 into vibe-d:master Jul 26, 2013

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