How...">

Anyway, to improve my gzip PHP method?

I gzip my pages now like this:

<?php
     ob_start("ob_gzhandler");

     //my page content

     ob_flush();
?>

However, I read a comment somewhere that this method uses a lot of memory, and I know that my site uses most of the memory on my virtual private server, so I thought it would be nice if I knew a way to reduce memory usage.

I tested my site using the online gzip tester, which says that my sites send gzipped pages, so my gzip method works, but most importantly, I'm obviously looking for an option with less memory, if any.

I appreciate all the suggestions. :) Oh, and Merry Christmas, P

+3
source share
4 answers

zlib.output_compression php.ini , , ob_gzhandler.

+3

Apache mod_deflate, Apache v2 + ( .htaccess)

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>

, - , , , .

, . .

+2

, Apache , , , JavaScript, CSS , , PHP- HTML:

http://httpd.apache.org/docs/2.2/en/mod/mod_deflate.html

+2

I apologize for my emphasis. This perefod is from translate.google.com. You are using ngix technology. If so, look at the ngx_http_gzip_static_module module. They say that it increases the speed of compression. And tell us about your character on your server.

+1
source

Source: https://habr.com/ru/post/1782018/


All Articles