PDA

View Full Version : gzip, Domino & findings ** Updated



Zakaroonikov
3 Sep 2007, 3:04 PM
I have been trying to implement the following technique for serving gzip files through Domino.

http://www.timtripcony.com/blog.nsf/d6plinks/GUIN-6YZ3DG

This technique does not automatically gzip the files on the fly but allows you to serve up these files by changing the Content-Encoding to 'gzip'. What I found out, however, is that if the files were being served up from our Window server's Domino/HTML directory instead of a .nsf then the gzip files were decoding properly.

After further investigation I determined that you also need to create 2 rules and change the 'Content-Type' to 'text/javascript' and 'text/css'. After this was done then the files were working correctly in Domino.

In my searching I also found this:

http://dojomino.com/dojomino/blog.nsf/d6plinks/LSPN-746PSC

Which gives some code on detecting if the browser has gzip support before serving them up. It is written for another framework but the code will still work.

I hope this helps someone!

galdaka
3 Sep 2007, 10:31 PM
Thanks, excellent info!!!

mth96a
6 Sep 2007, 10:14 AM
I use this to get passed Safari which responds corectly to be able to handle gzip files but does not.


@If(@Contains(@GetHTTPHeader("User-Agent");"Apple");
GZ1 := "ext/":
GZ2 := "" :
GZ3 := "extnd/";
GZ1 := @If(@Contains( @GetHTTPHeader("Accept-Encoding");"gzip"); "ext/gz/"; "ext/"):
GZ2 := @If(@Contains( @GetHTTPHeader("Accept-Encoding");"gzip"); ".gz"; ""):
GZ3 := @If(@Contains( @GetHTTPHeader("Accept-Encoding");"gzip"); "extnd/gz/"; "extnd/"));

"<!-- Ext JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + GZ1 + "adapter/ext/ext-base.js" + GZ2 + "'></script>" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + GZ1 + "ext-all" + mode + ".js" + GZ2 + "' ></script>" + @NewLine +
"<!-- Ext.nd JS library -->" + @NewLine +
"<script type='text/javascript' src='" + extndUrl + GZ3 + "extnd-all" + mode + ".js" + GZ2 + "'></script>" + @NewLine +
"<script type='text/javascript' src='" + dbPath + "Ext.nd.Session.js?ReadForm'></script>" + @NewLine +
"<script type='text/javascript'>" + @NewLine +
" Ext.nd.init({extndUrl : '" + extndUrl + "'});" + @NewLine +
"</script>" + @NewLine +

vajra
2 Nov 2007, 1:38 AM
I have created the web site rule for gzip files, gzip'd the files per Tim's instructions and put them into the Domino html directory. However, it gives me the error 'Invalid Character' when it tries to load the gzip files. In FireFox I can see that the Content-Encoding is being sent to application-x-gzip but the browser does not decode the files. You said you also added two additional rules to make this work. Would you please post them or maybe you can tell me what I am missing?

Thanks

Vajra

Zakaroonikov
4 Nov 2007, 12:54 PM
I have created the web site rule for gzip files, gzip'd the files per Tim's instructions and put them into the Domino html directory. However, it gives me the error 'Invalid Character' when it tries to load the gzip files. In FireFox I can see that the Content-Encoding is being sent to application-x-gzip but the browser does not decode the files. You said you also added two additional rules to make this work. Would you please post them or maybe you can tell me what I am missing?

Thanks

Vajra

Have a look at the following screen grabs:

vajra
8 Nov 2007, 12:40 PM
Thanks that seemed to work. I also noticed that I have to have these rules under the 'Default web site' or it will not work. Not sure if you had that same experience...

Vajra

bhaidaya
9 Nov 2007, 8:20 AM
Sup homie,
Hit me up if you need more but I got mine working by using these settings.. but I had to force the encoding on the individual files by putting them in a db and changing the resource properties like so...

vajra
9 Nov 2007, 8:30 AM
Thanks Baker...Now I have another option. Are you also gziping the CSS?

Vajra

Zakaroonikov
9 Nov 2007, 3:21 PM
Thanks that seemed to work. I also noticed that I have to have these rules under the 'Default web site' or it will not work. Not sure if you had that same experience...

Vajra

Another thing to note is it appears that if you have more than 1 rule about the same stuff they get overriden so make sure all your header rules for the gzip files are all in the 1 document. We are using it in the default site.

Zakaroonikov
9 Nov 2007, 3:23 PM
Sup homie,
Hit me up if you need more but I got mine working by using these settings.. but I had to force the encoding on the individual files by putting them in a db and changing the resource properties like so...

That is why I setup 2 separate rules one for css and one for gzip then you set the content type there to gzip and the content encoding to text/css. This rule should accomplish what you are trying to do. The problem with the resource properties is everytime you change then they seem to get set back to just text.