Current time: 04-02-2020, 04:06 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gzip dynamic html homepage
12-10-2013, 06:23 AM
Post: #1
gzip dynamic html homepage
Hello ,
I am getting a compression ding for the "www.qad.com/erp/" html content type home page.

http://www.webpagetest.org/result/131209...press_text

Should this dynamic html content type home page be gzipped?

Thanks.

TRX
Find all posts by this user
Quote this message in a reply
12-10-2013, 08:14 AM
Post: #2
RE: gzip dynamic html homepage
Yes :-) It doesn't really matter whether the page is static or dynamically generated. The web server compresses the output on the fly, based on the content-type of the requested file, like text/html, text/plain, text/css, etc.

GTMetrix has a short but clear write-up: http://gtmetrix.com/enable-gzip-compression.html
Find all posts by this user
Quote this message in a reply
12-10-2013, 08:21 AM
Post: #3
RE: gzip dynamic html homepage
For some reason while writing this post I was thinking of caching. Smile

What you said makes sense. I'll take a look at the GTMetrix.

Question, so if your gzip component failed for a page, would you say one would
just need to make the page (code) size smaller so the gzip does not fail?

Thanks!
Find all posts by this user
Quote this message in a reply
12-10-2013, 08:40 AM
Post: #4
RE: gzip dynamic html homepage
(12-10-2013 08:21 AM)trx Wrote:  For some reason while writing this post I was thinking of caching. Smile

Depending on their content / frequency of update you may be able to cache dynamically generated pages too - plenty of news sites do this

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2013, 09:21 AM (This post was last modified: 12-10-2013 09:24 AM by robzilla.)
Post: #5
RE: gzip dynamic html homepage
Quote:Question, so if your gzip component failed for a page, would you say one would
just need to make the page (code) size smaller so the gzip does not fail?

What makes you think it might fail? On-the-fly gzip compression is basic stuff for most web servers, and it's certainly not something that's known to fail. It'll work regardless of the size of your text file. The bigger the file (your HTML, CSS, XML or whatever), the more processing is required to compress it, but, modern CPUs being what they are, this isn't really an issue anymore.

Since you're running on IIS, this might help:
http://stackoverflow.com/questions/70212...-iis7-gzip
Find all posts by this user
Quote this message in a reply
12-10-2013, 09:27 AM
Post: #6
RE: gzip dynamic html homepage
I don't mean to use the word "fail" literally, but more in the way webpagetest graded the gzipped URL page. Link below:

http://www.webpagetest.org/result/131209...press_text

It is saying that the page could of saved more KB, but is that due to the page size too big or the gzip algorithm needing to be better configured?
Find all posts by this user
Quote this message in a reply
12-10-2013, 07:36 PM (This post was last modified: 12-10-2013 07:41 PM by robzilla.)
Post: #7
RE: gzip dynamic html homepage
(12-10-2013 09:27 AM)trx Wrote:  It is saying that the page could of saved more KB, but is that due to the page size too big or the gzip algorithm needing to be better configured?

It's due to gzip compression not being configured at all for the text/html content-type. It is enabled for your JS and CSS files.

Enabling compression will significantly decrease the size of your HTML (and other text files) in transfer. A page will be compressed on-the-fly on the server, regardless of its size, then sent (in compressed form) to the browser, which finally decompresses it. Nothing about the pages (the code) needs to be changed; all you have to do is enable gzip compression in the web server configuration.
Find all posts by this user
Quote this message in a reply
12-11-2013, 07:07 AM
Post: #8
RE: gzip dynamic html homepage
If CSS and JS are gzipped the server is likely configured to gzip text/*

It is a Windows Server and the page is created by ASP.NET.

Even on Apache when a CGI-Script generates the page it is not the same as a static page being served.
The programmer has to gzip it and set the headers.

For example in PHP to gzip, use chunked output buffers and gzip the buffers. Add the header()

I would never use an MS development tool like .NET but I would assume that gzip is an ASP page property. something like this:

HttpContext context = HttpContext.Current;
context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress);
HttpContext.Current.Response.AppendHeader("Content-encoding", "gzip");
HttpContext.Current.Response.Cache.VaryByHeaders["Accept-encoding"] = true;

In PHP you just add one line of code and it takes care of every thing: ob_start("ob_gzhandler");


]
Find all posts by this user
Quote this message in a reply
12-11-2013, 07:41 AM
Post: #9
RE: gzip dynamic html homepage
Quote:If CSS and JS are gzipped the server is likely configured to gzip text/*

That would include text/html, which currently isn't being compressed.

Quote:The programmer has to gzip it and set the headers.

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.
Find all posts by this user
Quote this message in a reply
12-11-2013, 10:14 AM
Post: #10
RE: gzip dynamic html homepage
Thanks for the feedback. Is it a good practice to gzip pages served from portal systems (i.e. IIS, Apache/Tomcat, Liferay, Vignette)?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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