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

Add support for response compression #1

Merged
merged 2 commits into from
Oct 6, 2015

Conversation

danielwhite
Copy link
Contributor

This utilises the Gorilla CompressHandler to compress responses if the client supports it.

The primary advantage is when MailHog is that this drastically reduces the response times when operating over a remote link. Without it, a single request for 50 messages can easily start reaching 10MB.

Given the push-button approach that MailHog is intended to support, requiring it to be deployed behind a "real" web-server seems like an extra unnecessary complication.

For this to work as expected, mailhog/MailHog-UI#9 is necessary to provide valid content types for all static content.

This uses a middleware pattern similar to the Gorilla Handlers to make
it easier to extend this handler further.
This makes MailHog more suitable for use in environments where testing
is happening over remote links. Without this, the main page load will
often respond with 10MB of data.
@ian-kent
Copy link
Member

ian-kent commented Oct 6, 2015

thanks again @danielwhite 👍

ian-kent added a commit that referenced this pull request Oct 6, 2015
Add support for response compression
@ian-kent ian-kent merged commit 183e2d6 into mailhog:master Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants