P.Z. Low Cost CPanel Web Hosting  

Go Back   P.Z. Low Cost CPanel Web Hosting > Page-Zone Web Hosting Main Forum > General FAQ > General Questions and Comments

General Questions and Comments Post your question or grace us with your knowledge. Posting limited to registered members.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
AddEncoding MIME-enc extension
Old
  (#1 (permalink))
Aleph
Registered User
Aleph is on a distinguished road
 
Status: Offline
Posts: 48
Join Date: Feb 2003
Rep Power: 38
Post AddEncoding MIME-enc extension - 03-07-2003, 03:13 AM

I performed a site scan on my site and was told that the HTML/JSP/CSS efficiency is at 40%. I was further advise the following

A note on HTML/JSP/CSS efficiency:

SiteScan efficiency ratings now include GZIP compression of Web page text and javascript. Web browsers and Web servers support compression of these objects and we are now including zip archives of the compressed files for you to download. GZIP+ compression is the combination of GZIP compression with our comment stripping optimization of HTML text.

Current Web servers support placing the ".gz" (GZIP) files in the same directory as the uncompressed originals. For example Apache, a very widely used Web server, has supported it for a couple years through the content negotiation module (documented here). Chances are you Web server is already setup to use ".gz" files.

The way content negotiation works is if the browser requests "mypage.html" and signals to the Web server that it can accept a compressed Web page, the Web server will look for "mypage.html.gz" and serve the compressed version instead. The few browsers (mainly Mac variants) that don't support compressed pages are served the original uncompressed version.


So I when to dig up further and realise to add the GZIP encoding I had to do this...

AddEncoding directive
Syntax: AddEncoding MIME-enc extension [extension] ...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime
The AddEncoding directive maps the given filename extensions to the specified encoding type.
MIME-enc is the MIME encoding to use for documents containing the extension. This mapping is
added to any already in force, overriding any mappings that already exist for the same extension.

Example:

AddEncoding x-gzip .gz
AddEncoding x-compress .Z

This will cause filenames containing the .gz extension to be marked as encoded using the x-gzip encoding, and filenames containing the .Z extension to be marked as encoded with x-compress.

Old clients expect x-gzip and x-compress, however the standard dictates that they're equivalent to gzip and compress respectively. Apache does content encoding comparisons by ignoring any leading x-. When responding with an encoding Apache will use whatever form (i.e., x-foo or foo) the client requested. If the client didn't specifically request a particular form Apache will use the form given by the AddEncoding directive. To make this long story short, you should always use x-gzip and x-compress for these two specific encodings. More recent encodings, such as deflate should be specified without the x-.

The extension argument is case-insensitive, and can be specified with or without a leading dot.




The newbie that I am needs help here. I checked Control Panel and tried adding via mime type and apache handlers to no avail. Does anyone knows how one can add encoding via C-Panel or otherwise?


P/S: In any case, hope the above is an interesting read for you as it was for me. :P
   
Reply With Quote
Old
  (#2 (permalink))
broken1
Registered User
broken1 is on a distinguished road
 
Status: Offline
Posts: 63
Join Date: Oct 2002
Rep Power: 42
03-07-2003, 12:53 PM

That was interesting, since I was not aware of anything like that.

But I think the question is, are you going to be gzipping all your files to serve them as compressed?

If not, I dont think you have to worry about it.

-Craig
www.brokenimage.com
   
Reply With Quote
Old
  (#3 (permalink))
Aleph
Registered User
Aleph is on a distinguished road
 
Status: Offline
Posts: 48
Join Date: Feb 2003
Rep Power: 38
03-07-2003, 10:14 PM

Yes, I'm thinking of gzipping all the html and css file. Not many anyway, and not tedious to do too. I figured if it would improve the loading speed for vistors, then why not right?

Basically, I will be keeping both versions (compressed and uncompressed) on the server, that way those using browser that doesn't support it will still be able to see the uncompression version like the article mentioned.

So any idea on how I can implement the AddEncoding Craig (or anybody else)? Any help is appreciated.
   
Reply With Quote
Old
  (#4 (permalink))
broken1
Registered User
broken1 is on a distinguished road
 
Status: Offline
Posts: 63
Join Date: Oct 2002
Rep Power: 42
03-08-2003, 07:43 PM

I checked cpanel and added it to the Mime types section using

x-gzip as mime encoding
and .gz as extension


I really have no idea of a good way to test to see if it works though.

-Craig
   
Reply With Quote
Old
  (#5 (permalink))
Aleph
Registered User
Aleph is on a distinguished road
 
Status: Offline
Posts: 48
Join Date: Feb 2003
Rep Power: 38
03-09-2003, 05:58 AM

Thanks Craig for the tip. I will do the same and wait for the next scheduled site scan to see if it detects the html.gz and js.gz files I uploaded.

Will keep you posted.
   
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
End of Road for FrontPage Server Extension on Unix Jim Announcements 1 07-14-2006 06:59 PM
Front Page Server extension vegasvic General Questions and Comments 1 06-22-2003 03:50 PM


Live Help



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC6
vBulletin Skin developed by: vBStyles.com
Copyright © 2002 Page-Zone Web Hosting. All rights reserved.
Smilies provided by Crack's Smilies http://www.mysmilies.com