LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Compression doesn't seem to work...

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2007, 11:28 AM
radixhound radixhound is offline
Member
 
Join Date: Feb 2007
Posts: 11
Question Compression doesn't seem to work...

Hi there!

I was checking out my Rails site with a free online site speed testing tool. It said that compression was not enabled for the site. I checked in the settings and sure enough compression was set to 'yes'. So I tried changing the MIME type to "text/*" ... no dice.

I'm not sure what else to try. I'm using Easy Rails and I added rewrite rules to handle the caching. I don't have rules to redirect to dispatch.lsapi, but my site is working fine without it. I don't even know if that has anything to do with it.

Why isn't the page compressed when it's delivered from the cache?
Reply With Quote
  #2  
Old 02-27-2007, 11:39 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
You need to give the user that LSWS run as write permission to the cache directory.
LSWS will create compressed version under the same directory where the original file is.
Reply With Quote
  #3  
Old 02-27-2007, 12:14 PM
radixhound radixhound is offline
Member
 
Join Date: Feb 2007
Posts: 11
Ok, that worked. This is what I did... (for posterity and so you can chastise me if I did it wrong)

I edited /etc/groups and added 'nobody' to the group that owns the public dir.
Then I changed all the directories in public to 775 with this...

chmod 775 public
find ./public -type d -exec chmod 775 {} \;

Then I restarted LSWS and voila! compression!
Reply With Quote
  #4  
Old 02-27-2007, 12:28 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
What you did is correct.

If you want tighter security, you can run lsws as a dedicate user other than nobody, there are many services using nobody, then set mode to 0770 instead of 0775, to only allow access from LSWS user and directory owner.
Reply With Quote
  #5  
Old 03-09-2007, 06:16 AM
fantasydreaming fantasydreaming is offline
Senior Member
 
Join Date: Sep 2006
Posts: 76
What free testing service did you use? I'd love to test mine as well to make sure I've configured compression properly
Reply With Quote
  #6  
Old 03-09-2007, 08:25 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
You don't need a the online tool, just install LiveHeader extension for firefox to check the response header.
Reply With Quote
  #7  
Old 03-26-2007, 11:03 PM
radixhound radixhound is offline
Member
 
Join Date: Feb 2007
Posts: 11
Default Free tools...

fantasydreaming: It may be a little late to respond to your question, but one of the ones I use is this one...

http://www.websiteoptimization.com/services/analyze/

I had another one that just tested compression that was great but I can't find it again using a quick search. The need to check isn't there anymore I guess.

And- checking the headers is one thing, but it's nice to see some verbose stats that interpret everything for you.
Reply With Quote
  #8  
Old 03-27-2007, 05:54 AM
fantasydreaming fantasydreaming is offline
Senior Member
 
Join Date: Sep 2006
Posts: 76
Compresing javascript: does it work for you?

The service you linked to shows my main content as being compressed, but not the javascript files..

I understand that some really old browsers have trouble with it, but I have some really big files so it's nice to be able to compress them.

I have my litespeed settings 'compressable' types set to:
text/*, application/x-javascript

I installed the firefox live header and sent it to the address of my big javascript file, and the resulting header was:
HTTP/1.x 200 OK

Server: LiteSpeed

Date: Tue, 27 Mar 2007 12:51:08 GMT

Accept-Ranges: bytes

Cache-Control: max-age=604800

Expires: Tue, 03 Apr 2007 12:51:08 GMT

Etag: "35a07-46081c25-839229"

Last-Modified: Mon, 26 Mar 2007 19:16:53 GMT

Content-Type: application/x-javascript

Content-Length: 219655
Reply With Quote
  #9  
Old 03-27-2007, 07:36 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
Make sure the directory that the script file resides is "writable" by litespeed user. This is a requirement for litespeed to compress static content as it writes/caches the compressed file as a ".lsz" file in that directory.
Reply With Quote
  #10  
Old 03-27-2007, 09:23 AM
radixhound radixhound is offline
Member
 
Join Date: Feb 2007
Posts: 11
Default Compressing Javascript

Compressing javascript worked for me, but I'm thinking of turning it off because some browsers don't support javascript compression very well. I haven't seen any problems directly with my own eyes but it's reported to be the case. As far as I remember, part of the problem is that caching doesn't work on IE browsers properly for .js and .css files that are compressed, so they end up getting reloaded every time from the server.

You might want to read up on it to see if you really want to compress javascript.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:32 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.