More information on internal redirection

Discussion in 'Ruby/Rails' started by rsilva, Sep 1, 2006.

  1. rsilva

    rsilva New Member

    Hi Guys,

    With the new Rails magic in 2.2, can you provide some more detailed information on what is happening behind the scenes. Are static files served up by Rails or LSWS? Is it doing a 404 redirect or mod_rewrite or custom detection? If custom, what rulesets are you using for redirecting to displatch.lsapi? I'm working on an article for the rubyonrails blog and want to provide the correct information.

    Also, any ideas you have planned for future releases that relate to ruby on rails would be helpful as well.

    Keep up the great work,

    Bob Silva
  2. xing

    xing LiteSpeed Staff

    Hey Bob,

    The "Rails Easy Config" of 2.2 release is using 404 redirect internally. If you have static items in the "/railapp/public" folder, then it will serve those directly. If requested item is not found in the public folder, it will be routed to Rails.

    1) Check item in /public folder.
    2) If not found, route to Rail.

    The Ruby on Rails world is evolving very fast right now so we can't say for sure what future feature we have in store for Rail developers. However, our overall platform goal is to make the complex, easy and fast. So any feature will be with that goal in mind.
    Last edited: Sep 1, 2006
  3. mistwang

    mistwang LiteSpeed Staff

    Thanks! Bob.

    Like Xing said, 404 handler is used, however, rewrite rules will be honored if configured. A few more points regarding the new configuration:

    • 404 handler is faster than rewrite rule. .htaccess support should be turned of when possible.
    • There is no need to create dispatch.lsapi in the public directory anymore. "dispatch.rb", "dispatch.fcgi" and "distpach.lsapi" are all pointing to the Rails LSAPI dispatcher created behind the scence to make sure it still works properly when the rewrite rule in the default .htaccess under public folder is used by accident.
    • The Rails dispatcher will be started in suEXEC mode if the virtual host is configured that way.
    We will write a tutorial on Capistrano integration in a cluster environment. And maybe add a feature to let user configure rails applications in shared hosting environment via something like .rails or just .htaccess.
    In the long run, we will continue to look for ways to boost Rails performance. :)

Share This Page