Add body compression middleware #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
velopert/velog#103
요기있던건데 닫혀버렸군요 ㅋㅋ
간단하게 compression 미들웨어 추가한 것입니다.
HTML/CSS/JS 도 그렇지만 GraphQL 응답도 종종 예상치 못하게 커지곤 하는데 (특히 introspection 이나 tracing extension 같은거 ㅋㅋ;)
간단하게 응답 압축하는 거만 빼먹지 않아도 앱 반응성을 크게 살릴 수 있습니다!
기본 옵션은 1KB 이상 응답일 때 acceptable encoding(서버 노드와 사용자 브라우저 모두 최신 환경이라면 brotli)으로 압축해서 페이로드 사이즈를 평균적으로 거의 70% 가까이 줄여주고 또한 응답을 chunked stream으로 바꾸어 내려주기도 합니다.