我使用這個PHP代碼的JSON輸出。 apache默認是gzip嗎?或者,我怎樣才能確認?默認情況下是否輸出Apache 2 gzip json?
header('Content-type: application/json');
header('Cache-Control: max-age=0,no-cache,no-store,post-check=0,pre-check=0');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
echo json_encode($response);
我相信這是你在找什麼。 http://www.simonwhatley.co.uk/how-to-configure-apache-to-gzip-your-components –