I would like to tell Apache, presumably through some rewrite rules
that any requests with query parameters should not be cached, but
instead passed down to the rack application. With a mongrel setup I
would just redirect it to the balancer if it meets my rewrite
conditions. How do you do the same with passenger?
Best,
Michael Guterl
You don't need to. Phusion Passenger does this automatically for you,
provided that you cache to 'public/'.
--
Phusion | The Computer Science Company
Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)
On Apr 2, 6:12 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Wed, Mar 24, 2010 at 3:22 PM,MichaelGuterl<mgut...@gmail.com> wrote:
> > I'm hosting a rack application with passenger and apache. The
> > application is setup to cache the content of each request to the
> > public directory after each request. This allows apache to serve the
> > content directly as a static page for future requests.
>
> > I would like to tell Apache, presumably through some rewrite rules
> > that any requests with query parameters should not be cached, but
> > instead passed down to the rack application. With a mongrel setup I
> > would just redirect it to the balancer if it meets my rewrite
> > conditions. How do you do the same with passenger?
>
> You don't need to. Phusion Passenger does this automatically for you,
> provided that you cache to 'public/'.
>
That's the problem, I want to avoid this behavior when the request has
query parameters, but serve the static version otherwise.
With thin, mongrel or any other upstream server in nginx I can do this
by using rewrite rules to detect the query parameters and use
proxy_pass to the rack server.
GET / <-- should use public/index.html
GET /?p=46 <-- should hit the rack application
Is there a way to do something similar with passenger?
Best,
Michael Guterl
Oh, I suppose this can be considered a bug. Please file a bug report.
In the mean time you can work around it by storing page cache files
outside public and use mod_rewrite rules to conditionally redirect to
page cache files.
On Apr 3, 10:50 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Sat, Apr 3, 2010 at 4:23 PM,MichaelGuterl<mgut...@gmail.com> wrote:
> > That's the problem, I want to avoid this behavior when the request has
> > query parameters, but serve the static version otherwise.
>
> > With thin, mongrel or any other upstream server in nginx I can do this
> > by using rewrite rules to detect the query parameters and use
> > proxy_pass to the rack server.
>
> > GET / <-- should use public/index.html
> > GET /?p=46 <-- should hit the rack application
>
> > Is there a way to do something similar with passenger?
>
> Oh, I suppose this can be considered a bug. Please file a bug report.
>
Filed here: http://code.google.com/p/phusion-passenger/issues/detail?id=480
> In the mean time you can work around it by storing page cache files
> outside public and use mod_rewrite rules to conditionally redirect to
> page cache files.
>
Thank you for the suggestion!
Best,
Michael Guterl