Jose Luis Rivas Contreras wrote:
> Hi, Jose, I play with error_redir a bit, and add a vhost as follows:
> ----8<-------------------
> Server fang {
> DocumentRoot /home/fang/Ruby/WebApps/production/public
>
> Extension scgi {
> Handler scgi {
> Server localhost:9999
> }
> }
>
> Directory / {
> Handler scgi {
> Server localhost:9999
> }
> }
>
> Directory / {
> Handler common
> }
>
> ErrorHandler error_redir {
> 404 http://fang/dispatch.scgi
> }
>
> }
> ------------->8-------------
>
> First, I notice that file handler get higher priority, which is
> good, however, while request a nonexist path, the server simplay
> rediret to http://fang/dispatch.scgi, thus involve scgi handler,
> however, with CHEROKEE_TRACE="all", I get the info that scgi handler
> doesn't pass the original path_info to the backend, so I get from
> scgi backend "dispatch.scgi" action doesn't exist error. What I am
> looking for is an integrated solution for cache generated webpage,
> so I need the following serving logic
>
> if exist cached file
> file handler server the static page
> else
> pass request to backend scgi server, and save generate page to filesytem.
> ...
> Any further suggestions?
We have discussed this issue a couple of times previously. There is
a reason for the current behaviour, actually. The idea is to provide
the server enough information to let it make a decision on how to
manage the connection without needing to read the hard disk.
Personally, I'd use a configuration file like this:
======
DocumentRoot /home/fang/Ruby/WebApps/production/public
Directory / {
Handler scgi {
Server localhost:9999
}
}
Directory /public { Handler file }
Directory /images { Handler file }
Directory /icons {
Handler file
DocumentRoot /usr/share/cherokee/icons/
}
======
The biggest difference is that, in this way, Cherokee always knows
what to do with the requests without accessing the files if it
doesn't need it, and hence, it's much faster.
--
Greetings, alo.
_______________________________________________
Cherokee mailing list
[email protected]
http://www.0x50.org/cgi-bin/mailman/listinfo/cherokee