Skip to content

Add body compression middleware #22

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

Merged
merged 1 commit into from
Mar 3, 2020
Merged

Add body compression middleware #22

merged 1 commit into from
Mar 3, 2020

Conversation

cometkim
Copy link
Contributor

velopert/velog#103

요기있던건데 닫혀버렸군요 ㅋㅋ

간단하게 compression 미들웨어 추가한 것입니다.
HTML/CSS/JS 도 그렇지만 GraphQL 응답도 종종 예상치 못하게 커지곤 하는데 (특히 introspection 이나 tracing extension 같은거 ㅋㅋ;)

간단하게 응답 압축하는 거만 빼먹지 않아도 앱 반응성을 크게 살릴 수 있습니다!

기본 옵션은 1KB 이상 응답일 때 acceptable encoding(서버 노드와 사용자 브라우저 모두 최신 환경이라면 brotli)으로 압축해서 페이로드 사이즈를 평균적으로 거의 70% 가까이 줄여주고 또한 응답을 chunked stream으로 바꾸어 내려주기도 합니다.

@velopert
Copy link
Owner

velopert commented Mar 1, 2020

오오 감사합니다.
이번주안에 검토해보고 merge 하겠습니다.

그나저나 벨로그 서버 초기셋업 가이드라인 만든다는게..
계속 미뤄지고 있네요~ :0

Copy link
Owner

@velopert velopert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스테이지에도 배포해보고 문제 없었습니다.
감사합니다!

@velopert velopert merged commit c216572 into velopert:master Mar 3, 2020
@cometkim cometkim deleted the compress-body branch March 4, 2020 15:15
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