* curl로 Content-Encoding: gzip 확인하기*
- 테스트 버전 : WEBTOB4.1.9.1, WEBTOB 5.0.0.4
- 설정 : html SVGNAME = htmlg, MinProc = 10, MaxProc = 10, Compression ="text/html"
호출 :curl -vk http://www.test.co.kr/test.html -H "Accept-Encoding: gzip" -o test.html
* 결과
WEBTOB4.1.9.1
* Trying 127.0.0.1...
* Connected to www.test.co.kr (127.0.0.1) port 80 (#0)
> GET /test.html HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.test.co.kr
> Accept: */*
> Accept-Encoding: gzip
>
< HTTP/1.1 302 Found
< Date: Wed, 21 Sep 2022 08:20:31 GMT
< Connection: close
< Location: https://www.test.com/test.html
< Content-Type: text/html
< Content-Length: 140
<
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
* Failure writing output to destination
* Closing connection 0
WEBTOB5.0.0.4
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to www.test.co.kr port 80 (#0)
* Trying 127.0.0.1...
* Connected to www.test.co.kr (127.0.0.1) port 80 (#0)
> GET /test.html HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.test.co.kr
> Accept: */*
> Accept-Encoding: gzip
>
< HTTP/1.1 302 Found
< Date: Wed, 21 Sep 2022 08:20:31 GMT
< Connection: close
< Location: https://www.test.com/test.html
< Content-Type: text/html
< Content-Length: 140
<
{ [data not shown]
100 140 100 140 0 0 9133 0 --:--:-- --:--:-- --:--:-- 10000
* Closing connection 0
- 특이사항
WebtoB4 compression은 브라우저에서 제공되는 것이기 때문에, curl에서는 압축을 풀수 없음.
위 Warning 메시지 표출됨.
다만, 아래와 같이 -o test.gz 설정을 추가하여 압축 파일로 형태로 내려 받을 수 있음.
curl -vk http://www.test.co.kr/test.html -H "Accept-Encoding: gzip" -o test.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 127.0.0.1:80...
* Connected to www.test.co.kr (127.0.0.1) port 80 (#0)
> GET /test.html HTTP/1.1
> Host: www.test.co.kr
> User-Agent: curl/7.79.1
> Accept: */*
> Accept-Encoding: gzip
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Tue, 20 Sep 2022 06:59:36 GMT
< ETag: "0-1218-5aadf2dc"
< Last-Modified: Sun, 18 Mar 2018 05:02:20 GMT
< Accept-Ranges: bytes
< Content-Type: text/html
< Content-Encoding: gzip
< Content-Length: 546
<
{ [data not shown]
100 140 100 140 0 0 9133 0 --:--:-- --:--:-- --:--:-- 10000
* Closing connection 0
생성된 파일 확인
vi test.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE> 302 Found </TITLE>
</HEAD><BODY>
<H1>Found</H1>
<HR>
</BODY></HTML>
'MiddleWare > WebtoB' 카테고리의 다른 글
[WebtoB] URLRewrite 설정 (0) | 2022.10.11 |
---|---|
[WebtoB] Shared Memory 에러 해결 방법 (0) | 2022.10.11 |
[WebtoB] DOCROOT, URI, EXT, GotoEXT 설정 (0) | 2022.08.10 |
[WebtoB] TRACE LOG 설정 (0) | 2022.08.04 |
[WebtoB] X-Forwarded-For(XFF) 설정 (1) | 2022.08.04 |