It seems (JSON) output isn't (gzip) compressed. Could you enable compression to reduce transfer time?
For example, I see server_export.php has 1.6MB JSON output size..
Maybe I'm not familiar enough, but in Firebug I see that after a GET of server_export.php, the HTTP reply contains "Content-Encoding" set to "gzip" and "Content-Type" is "application/json".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
phpMyAdmin concludes that output buffering is not possible, as we can see in "X-ob_mode: 0". A possible reason is php.ini's value of output_handler set to "ob_gzhandler".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looking in libraries/OutputBuffering.class.php in _getMode(), a few simple conditions are checked. I believe that the only one to verify is this: does the ob_start() function exist on your server?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Debian has:
; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; Turning on this setting and managing its maximum buffer size can yield some
; interesting side-effects depending on your application and web server.
; You may be able to send headers and cookies after you've already sent output
; through print or echo. You also may see performance benefits if your server is
; emitting less packets due to buffered output versus PHP streaming the output
; as it gets it. On production servers, 4096 bytes is a good setting for performance
; reasons.
; Note: Output buffering can also be controlled via Output Buffering Control
; functions.
; Possible Values:
; On = Enabled and buffer is unlimited. (Use with caution)
; Off = Disabled
; Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
output_buffering = 4096
I wonder what the correct and portable way to do gzip compression for PHP is.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cannot reproduce in 4.4.0, if I enable compression via the custom export panel.
Ah, this isn't about exporting data but about normal (AJAX) HTTP requests / responses.
Maybe I'm not familiar enough, but in Firebug I see that after a GET of server_export.php, the HTTP reply contains "Content-Encoding" set to "gzip" and "Content-Type" is "application/json".
Hmm
GET /pma/db_structure.php?server=1&db=tpt&token= HTTP/1.1
Host: router
Connection: keep-alive
Authorization: Basic
Accept: /
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36
Referer: http://router/pma/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,nl;q=0.6
Cookie: ***
HTTP/1.1 200 OK
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Last-Modified: Wed, 01 Apr 2015 16:30:44 GMT
X-ob_mode: 0
Cache-Control: no-cache
Content-Type: application/json
Transfer-Encoding: chunked
Date: Thu, 02 Apr 2015 16:05:19 GMT
Server: lighttpd/1.4.35
fff8
{"message":" ...
Perhaps your web server takes care of the compression while mine (Lighttpd) doesn't. Should be taken care of in PHP (code) though.
What's the value of your $cfg['OBGzip'] setting?
unset
Can you try with Firefox?
Also, what's your php.ini zlib.output_compression value?
Isn't installed, but here's IE:
GET /pma/phpmyadmin.css.php?server=1&token=X HTTP/1.1
Accept: text/css, /
Referer: http://router/pma/
Accept-Language: nl-NL
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Host: router
DNT: 1
Connection: Keep-Alive
Cookie: pma_lang=en; pma_collation_connection=utf8_unicode_ci; phpMyAdmin=X
Authorization: Basic X
HTTP/1.1 200 OK
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Wed, 01 Apr 2015 16:30:44 GMT
Content-Type: text/css; charset=UTF-8
Expires: Thu, 02 Apr 2015 17:18:36 GMT
Transfer-Encoding: chunked
Date: Thu, 02 Apr 2015 16:18:36 GMT
Server: lighttpd/1.4.35
zlib.output_compression = Off (default AFAIK)
phpMyAdmin concludes that output buffering is not possible, as we can see in "X-ob_mode: 0". A possible reason is php.ini's value of output_handler set to "ob_gzhandler".
That's not set either:
;output_handler =
Looking in libraries/OutputBuffering.class.php in _getMode(), a few simple conditions are checked. I believe that the only one to verify is this: does the ob_start() function exist on your server?
ob_get_level() returns 1, perhaps due to output_buffering = 4096 (default).
According to http://php.net/manual/en/ini.list.php the default value of output_buffering is 0. In my environment, this setting is not defined.
Debian has:
; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; Turning on this setting and managing its maximum buffer size can yield some
; interesting side-effects depending on your application and web server.
; You may be able to send headers and cookies after you've already sent output
; through print or echo. You also may see performance benefits if your server is
; emitting less packets due to buffered output versus PHP streaming the output
; as it gets it. On production servers, 4096 bytes is a good setting for performance
; reasons.
; Note: Output buffering can also be controlled via Output Buffering Control
; functions.
; Possible Values:
; On = Enabled and buffer is unlimited. (Use with caution)
; Off = Disabled
; Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
output_buffering = 4096
I wonder what the correct and portable way to do gzip compression for PHP is.
How about this patch?
Looks good, though CSS and JS don't get compressed.
Fix: https://github.com/phpmyadmin/phpmyadmin/commit/8d16b2d93795d8c6a643e60eb92598ece3911461
See also https://sourceforge.net/p/phpmyadmin/bugs/4833/