How to create gzip compression

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mFreak
    replied
    Originally posted by softwarefreak View Post
    No need to add ob_end_flush() :P output is flushed by default :P until u don't use end clean :D
    what if he need to output before the script ends :P. Just trying to be smart ;), thanks for info.

    Leave a comment:


  • softwarefreak
    replied
    Originally posted by mFreak View Post
    and he should add
    PHP Code:
    ob_end_flush(); 
    at the end of the script. But zlib ob is encouraged if its avaible, as I read somewhere.
    No need to add ob_end_flush() :P output is flushed by default :P until u don't use end clean :D

    Leave a comment:


  • mFreak
    replied
    Originally posted by GumSlone View Post
    add this on the top of your pages:

    PHP Code:
    if(strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip"))
        {
            
    header("Content-Encoding: gzip");
            
    header("Vary: Accept-Encoding");
            
    ob_start('ob_gzhandler');
        } 
    and he should add
    PHP Code:
    ob_end_flush(); 
    at the end of the script. But zlib ob is encouraged if its avaible, as I read somewhere.

    Leave a comment:


  • GumSlone
    replied
    add this on the top of your pages:

    PHP Code:
    if(strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip"))
        {
            
    header("Content-Encoding: gzip");
            
    header("Vary: Accept-Encoding");
            
    ob_start('ob_gzhandler');
        } 

    Leave a comment:


  • mFreak
    replied
    Originally posted by Rrobyf View Post
    master, please share tutorial create gzip compression for wapsite
    what do you want to do? Make gzip archives or gzip output compression?

    Added after 3 minutes:

    for output compression check zlib.output.compression or ob_gzhandler at php.net PHP: Runtime Configuration - Manual

    Added after 2 minutes:

    and again for creating files you can use zlib library, PHP: Zlib - Manual ,
    Last edited by mFreak; 06.08.12, 06:59.

    Leave a comment:


  • Rrobyf
    started a topic How to create gzip compression

    How to create gzip compression

    master, please share tutorial create gzip compression for wapsite
Working...
X