Re: Content-Type / AddOutputFilterByType DEFLATE text/html

2017-08-07 Thread Reindl Harald
OK, the reason are the HEAD-Requests triggered by curl_setopt($curl, 
CURLOPT_NOBODY, 1); so the bug is ignoring that in case of 
"/static.htm?count=250_150209658" and sending in fact a body back while 
for the 3 other test urls the response is HEAD as requested and the curl 
code is identical


 $curl = curl_init();
 curl_setopt($curl, CURLOPT_NOBODY, 1);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
 curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Fedora; Linux 
x86_64; rv:55.0) Gecko/20100101 Firefox/55.0');

 curl_setopt($curl, CURLOPT_HEADER, 1);
 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
 curl_setopt($curl, CURLOPT_URL, $url);
 curl_setopt($curl, CURLOPT_HTTPHEADER, $curl_header);

Am 07.08.2017 um 11:12 schrieb Reindl Harald:

Hi

AddOutputFilterByType DEFLATE text/html

is this a bug or somehow expected behavior that in case the 
"Content-Type" header also contains a charset mod_defalte don't work as 
expected which means in case of curl requests only static files are gzip 
compressed while PHP responses are missing "Content-Encoding: gzip" - 
that this don't happen in case of Firefox as client makes it even more 
strange


identical result for "Content-Type: text/html; charset=UTF-8" in case 
"default_charset" is not set in php.ini


the last line of each block is the PHP array for curl_setopt($curl, 
CURLOPT_HTTPHEADER, $curl_header);


NO GZIP
http://corecms/index.php?count=250_1502096587
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=1744 us
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-cache
ETag: 7d820de3763d0e6c22ccbfe846ab1c31
Vary: User-Agent
Content-Type: text/html; charset=ISO-8859-1
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


NO GZIP
http://corecms/
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=400 us
Cache-Control: max-age=120
Expires: Mon, 07 Aug 2017 09:05:08 GMT
Vary: User-Agent
Content-Type: text/html; charset=ISO-8859-1
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


GZIP OK
http://corecms/static.htm?count=250_1502096587
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=297 us
Last-Modified: Sun, 06 Aug 2017 17:49:54 GMT
ETag: "ec1-556195b938c8f-gzip"
Accept-Ranges: bytes
Cache-Control: max-age=120
Expires: Mon, 07 Aug 2017 09:05:08 GMT
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 890
Content-Type: text/html
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


NO GZIP
http://corecms/static.php?count=250_1502096587
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=280 us
Cache-Control: max-age=120
Expires: Mon, 07 Aug 2017 09:05:08 GMT
Vary: User-Agent
Content-Type: text/html; charset=ISO-8859-1
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


Content-Type / AddOutputFilterByType DEFLATE text/html

2017-08-07 Thread Reindl Harald

Hi

AddOutputFilterByType DEFLATE text/html

is this a bug or somehow expected behavior that in case the 
"Content-Type" header also contains a charset mod_defalte don't work as 
expected which means in case of curl requests only static files are gzip 
compressed while PHP responses are missing "Content-Encoding: gzip" - 
that this don't happen in case of Firefox as client makes it even more 
strange


identical result for "Content-Type: text/html; charset=UTF-8" in case 
"default_charset" is not set in php.ini


the last line of each block is the PHP array for curl_setopt($curl, 
CURLOPT_HTTPHEADER, $curl_header);


NO GZIP
http://corecms/index.php?count=250_1502096587
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=1744 us
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-cache
ETag: 7d820de3763d0e6c22ccbfe846ab1c31
Vary: User-Agent
Content-Type: text/html; charset=ISO-8859-1
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


NO GZIP
http://corecms/
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=400 us
Cache-Control: max-age=120
Expires: Mon, 07 Aug 2017 09:05:08 GMT
Vary: User-Agent
Content-Type: text/html; charset=ISO-8859-1
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


GZIP OK
http://corecms/static.htm?count=250_1502096587
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=297 us
Last-Modified: Sun, 06 Aug 2017 17:49:54 GMT
ETag: "ec1-556195b938c8f-gzip"
Accept-Ranges: bytes
Cache-Control: max-age=120
Expires: Mon, 07 Aug 2017 09:05:08 GMT
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 890
Content-Type: text/html
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}


NO GZIP
http://corecms/static.php?count=250_1502096587
HTTP/1.1 200 OK
Date: Mon, 07 Aug 2017 09:03:08 GMT
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Response-Time: D=280 us
Cache-Control: max-age=120
Expires: Mon, 07 Aug 2017 09:05:08 GMT
Vary: User-Agent
Content-Type: text/html; charset=ISO-8859-1
a:2:{i:0;s:58:"Cookie: 
LOUNGE_ID=pivked76ocg1n9750n91d3dtnqqpqhpmqci63pvo";i:1;s:30:"Accept-Encoding: 
gzip, deflate";}