Hi Railers! Is anyone using page caching on lighty with Rails? I cannot figure out how to tune it (particularly because the docs on rewrite in lighty are so sparse). My problem is - I had all cached pages dumped into a special directory under my /public, which was done to: a) exclude cache from SVN (other caches, such as images and fragments, are dumped there as well) b) leave space in the docroot for meaningful things :-) In Apache it was almost trivial to rewrite all requests to the cached files if these files are available (the -f flag), but how should I do it with lighttpd? What I need is exactly page caching (completely bypass the Rails dispatcher for pages which don''t change often). -- Julian "Julik" Tarkhanov
On 9/3/05, Julian ''Julik'' Tarkhanov <listbox-RY+snkucC20@public.gmane.org> wrote:> In Apache it was almost trivial to rewrite all requests to the cached > files if these files are available (the -f flag), but how should I do > it with lighttpd? What I need is exactly page caching (completely > bypass the Rails dispatcher for pages which don''t change often).-------- from lighttpd.conf ------------->8------- server.modules = ( ... "mod_rewrite", ... url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) server.error-handler-404 = "/dispatch.fcgi" ---------------------------------------------->8----------- cached pages are {action}.html inside public/ dir
Just to clarify here - the -f behavior in Apache is the default behavior of lighttpd. Joshua On 9/4/05, Stoyan Zhekov <stoyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 9/3/05, Julian ''Julik'' Tarkhanov <listbox-RY+snkucC20@public.gmane.org> wrote: > > > In Apache it was almost trivial to rewrite all requests to the cached > > files if these files are available (the -f flag), but how should I do > > it with lighttpd? What I need is exactly page caching (completely > > bypass the Rails dispatcher for pages which don''t change often). > > -------- from lighttpd.conf ------------->8------- > > server.modules = ( > ... > "mod_rewrite", > ... > > url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) > server.error-handler-404 = "/dispatch.fcgi" > > ---------------------------------------------->8----------- > cached pages are {action}.html inside public/ dir > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 4-sep-2005, at 19:10, Stoyan Zhekov wrote:> url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )Wow, Stoyan! Thanks a bunch - being used to -F I forgot that we _already_ have the dispatcher handling missing stuff! For me (willing to keep static stuff outside of docroot) this sums up to url.rewrite = ( "^/$" => "cached/index.html", "^([^.]+)$" => "cached/ $1.html" ) Wonderful. -- Julian "Julik" Tarkhanov