Can php disable nginx gzip output on the current page?

Source: Internet
Author: User
Php writes a cache with no refreshing output, but it is invalid when nginx sets gzip compression. How can I set php to disable gzip output on the current page. I tried to set php. ini to disable it, but it is difficult to make {code...} I think it may be because my gzip output is set through nginx...

Php writes a cache with no refreshing output, but it is invalid when nginx sets gzip compression. How can I set php to disable gzip output on the current page.

I tried to set php. ini to disable it.

ini_set('zlib.output_compression', 'off');

I think it may be because my gzip output is set through nginx.

Of course, you cannot use nginx to disable gzip on the entire site. I only want to disable gzip on the current page. What can I do?

Reply content:

Php writes a cache with no refreshing output, but it is invalid when nginx sets gzip compression. How can I set php to disable gzip output on the current page.

I tried to set php. ini to disable it.

ini_set('zlib.output_compression', 'off');

I think it may be because my gzip output is set through nginx.

Of course, you cannot use nginx to disable gzip on the entire site. I only want to disable gzip on the current page. What can I do?

Nginx configuration file location ~ . *. (Php | php5 )? $ {
Gzip off; # disable gzip fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; include fcgi. conf;} If gzip compression is required on a php page, use ob_start ("ob_gzhandler"); ob_start ("compress ");

I have never met such a requirement, but my website adds this code to the top and bottom of the page by enabling gzip compression on the page.


  …………
  

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.