The JSON-formatted data returned in the PHP program is compressed with gzip output method, Jsongzip
1. Comparison of HTTP output with compression and not using compression
2. Turn on gzip
Use Apache Mod_deflate module to open gzipTo open a method:
Use gzip to compress the JSON format data returned by the PHP program.
1. Comparison between HTTP output with and without compression
2. Enable gzip
Use apache mod_deflate module to enable gzipEnabling method:
sudo a2enmod deflatesudo
1. Compare HTTP output with HTTP output without compression 2. Enable gzip by using apachemod_deflatemodule. Enable gzip. Disable. dapache2restart: Disable. dapache2restart3. Set gzip compression output
1. use compression and HTTP output without
GZIP is a very popular data compression format for use on the Internet, or a file format. Using GZIP to reduce storage space, and then transfer files over the network, you can reduce the transmission time.Large-flow Web sites often use the gzip
Objective:Have done the Android network development know, in the network transmission we generally will turn on GZIP compression, but out of the nature of inquisitive only know how to open can not satisfy my curiosity, so think to write a demo test
The quality of front-end development engineers is directly related to the speed of page access (JOHN: You know, using an extremely ugly table to set the pages made by the table is much more expensive than the simple Div and table pages, both in K
This article mainly introduces how to use gzip to compress and output JSON data returned by PHP. the sample environment in this article is Linux and Apache server. if you need it, refer
1. Comparison between HTTP output with and without compression
Now Webapi more and more popular, often it is used to do interface return JSON format data, WEBAPI originally based on the type of client is dynamically serialized to JSON and XML, but in fact, many times we are serialized into JSON, So WEBAPI
1. Comparison of HTTP output with compression and not using compression
2. Turn on gzip
Use Apache mod_deflate module to open gzipTo open a method:
sudo a2enmod deflatesudo/etc/init.d/apache2 restart
Close method:
sudo a2dismod
This article describes how to compress pages to save website bandwidth and increase user access speeds.
The website access speed is determined by multiple factors, such as the application response speed, network bandwidth, server performance, and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.