Current time: 03-08-2021, 01:42 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gzip dynamic html homepage
12-12-2013, 06:39 AM (This post was last modified: 12-12-2013 07:11 AM by iSpeedLink.com.)
Post: #12
RE: gzip dynamic html homepage
(12-11-2013 07:41 AM)robzilla Wrote:  It's generally a better idea to have the web server take care of that. Whether your page is dynamically generated or a static .html file doesn't really matter as long as it's served as text/html. Your web server, if set up properly, will take care of everything.

You are correct. Thank you.
Easier AND Better.

I was under the impression that the programmer had to do the gzip.
I did not know which was better so I tested.

The test Results with no .htaccess and the following PHP
PHP Code:
ob_start("ob_gzhandler");
header('Content-Type: text/html; charset=utf-8');
header('Connection: Keep-Alive');
header('Keep-Alive: timeout=5, max=100'); 

http://www.webpagetest.org/result/131210_61_139W/

Results after adding the following .htaccess and removing the ob_gzhandler:

ob_start();


http://www.webpagetest.org/result/131210...1/details/

Code:
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_include mime ^application/javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

The WPT results have too many variables to make a fair assessment.

Further testing showed that there is no performance difference between the two methods. The next test method I ran a PHP script that retrieved the test pages alternately 60 times each by IP address (no DNS). Running the test on the same Server as the test pages nearly eliminated the other variables of connect time and transmission. The two test pages are identical other than the gzhandler so the HTML generation will be identical This pretty much leaves just the gzip process as the only test variable with everything else being nearly constant. The test results "Wait" time column represents the time to run the script and gzip the generated HTML.

The results, as shown on the attached PDF, are very conclusive the two gzip methods are identical with negligible difference in the total load and Wait times two test times.

The "better" is not performance related but it's always better to have options. And better to know what the options are. After giving it consideration I doubt I'm going to use the .htaccess method and will continue to use the PHP gzhandler. I sometimes use PHP to deliver very small (less than 200 bytes) and or binary payloads (e.g. images, PDF) where gzip would be an inappropriate waste of time.

My next test will be to see if the PHP routines responds with a content type of image/.* test whether the image content type in the header will hold precedence over the php extension the gzip routine.


Attached File(s)
.pdf  tzRcvTime120.pdf (Size: 75.91 KB / Downloads: 55)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
gzip dynamic html homepage - trx - 12-10-2013, 06:23 AM
RE: gzip dynamic html homepage - robzilla - 12-10-2013, 08:14 AM
RE: gzip dynamic html homepage - trx - 12-10-2013, 08:21 AM
RE: gzip dynamic html homepage - robzilla - 12-10-2013, 09:21 AM
RE: gzip dynamic html homepage - trx - 12-10-2013, 09:27 AM
RE: gzip dynamic html homepage - robzilla - 12-10-2013, 07:36 PM
RE: gzip dynamic html homepage - robzilla - 12-11-2013, 07:41 AM
RE: gzip dynamic html homepage - iSpeedLink.com - 12-12-2013 06:39 AM
RE: gzip dynamic html homepage - trx - 12-11-2013, 10:14 AM
RE: gzip dynamic html homepage - robzilla - 12-11-2013, 09:10 PM
RE: gzip dynamic html homepage - robzilla - 12-12-2013, 08:08 AM
RE: gzip dynamic html homepage - trx - 06-27-2014, 02:21 PM
RE: gzip dynamic html homepage - trx - 04-02-2015, 06:41 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)