Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's been a LONG time since i had to use zlib compression on OB (more on why later). However, let me try and convince you to turn OFF zlib compression on OB in PHP. First of all, a little background to ensure we are on the same page.</p> <p>HOW DOES OB WORK</p> <p>Everytime php prints something, without OB it would be sent straight to apache and from apache to the browser. Instead, with OB, the output stops at apache and waits until the data is flushed (to the browser) or until the script ends and the data is flushed automatically. This saves quite a lot of time and resources when generating a page by buffering the Apache to Web Browser stage of the process.</p> <p>WHY NOT TO USE OB COMPRESSION IN PHP</p> <p>Why would you make PHP compress it? It should be the servers job to do such tasks (as well as compress js files for example). What you "should" do to drastically free apache to process php is to install NGINX as a front to the public. It's VERY easy to setup as a reverse proxy and you can even install it on the SAME server as php and apache.</p> <p>So set NGINX on port 80, put apache on say 8080 (and only allow nginx to connect, but don't worry if you leave it public for a little time as it was already public and great for debugging to bypass nginx so no security issues should rise - but i recommend you don't leave it public for to long). Then make nginx reverse proxy to apache, cache all static files which offloads that from apache (because nginx serves them instead) meaning apache can do more php requests, and also get nginx to perform OUTPUT COMPRESSION ;) freeing up apache and php to do even more requests. As an added benefit, nginx can also serve static files much faster than Apache and Nginx also uses much less ram and can handle much more connections.</p> <p>Even an nginx newbie could get nginx setup after reading a few tutorials online and complete everything i just said within 1 day. 1 day well spent as well.</p> <p>Remember to KEEP output buffering ON however for PHP to Apache but turn zlib compression OFF on PHP and enable it instead on nginx.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload