|
|

10-13-2006, 11:07 PM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Rails Caching
I setup Rails Caching using the caches_page method. I can see the files being created in /public, yet according to the production.log Rails is still processing every file.
Any ideas??? Do I need to setup a directive in the VirtualHost for the Rails app, or could it be arouting problem, or something else?
Thanks!!
|

10-14-2006, 06:54 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
Not sure what cause that, the URL must be exactly as the the file name, index file should be set properly.
You can turn on debug logging see what exactly is happening.
|

10-14-2006, 08:25 PM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Quote:
Originally Posted by mistwang
Not sure what cause that, the URL must be exactly as the the file name, index file should be set properly.
You can turn on debug logging see what exactly is happening.
|
An example URL is http://www.domain.com/view/page/17
On my server I have
/domain/current/public/view/page/17.html
Now, I noticed in the VirtualHost that under the "Rewrite" tab, "Enable rewrite" is off by default. Do I need to turn that on for LS to be able to turn .../page/17 into .../page/17.html??
Any other settings that "should" be right but might be a good idea for me to double check?
Thanks for all your help!!
I'll send you a copy via PM of the error.log with the highest level of debugging for a request.
Last edited by jp_n9; 10-14-2006 at 08:43 PM..
|

10-14-2006, 08:30 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
Yes, you need to rewrite the url. 
|

10-14-2006, 08:46 PM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
|
I tried turning it on, but it doesn't seem to have changed anything. Ooops. Just saw you said the URL needs to be rewritten. How?
|

10-14-2006, 08:54 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
You can just turn on .htaccess support, the rewrite rules in public/.htaccess should take care of it.
|

10-14-2006, 09:16 PM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Quote:
Originally Posted by mistwang
You can just turn on .htaccess support, the rewrite rules in public/.htaccess should take care of it.
|
I found the "Allow Override" setting, but it has a bunch of check boxes which aren't explained - so I'm not sure how to "turn on" the .htaccess support. I tried checking all except for the "none" and restarted. Didn't seem to work.
I then adding the following rewrite rules copied from .htacess:
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
I restarted. Again, it still doesn't seem to be working.
What am I doing wrong?
|

10-14-2006, 09:31 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
rewrite rules in .htaccess are slightly different from rules at vhost level. The rewrite base (directory path) has been removed for rewrite rules in .htaccess. You need to modify those rewrite rules to take care of this.
try something like
RewriteRule ^(.*)/$ $1/index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
Or, you can turn off htaccess and use those rules in the rails context configuration, but not at the vhost level.
|

10-15-2006, 08:12 AM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Quote:
Originally Posted by mistwang
try something like
RewriteRule ^(.*)/$ $1/index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
|
I turned off .htaccess and added the above rewrite rules in at the vhost level. Works great!! Thanks!
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 09:10 AM.
|
|