From: Dick Davies Date: 2005-06-24T22:46:33+09:00 Subject: Re: FastCGI: handling the caching of ruby scripts. * Jonas Hartmann [0625 14:25]: > FastCGIs idea of caching scripts on first startup is a great thing but: > > - Sometimes you need to reload scripts > - If you are developing, reloading scripts that have been modified is > needed. It's not so much that it caches, just that it doesn't exit. > My idea was to support two ways of reloading. > 1.) A GET/POST variable from HTTP can force the script to stops its > FCGI process and launches itself again after that. > > 2.) The script has to detect if the user-agent send an force-refresh. > (Shift+Reload in Firefox for example). If that is the case, the script > stops its FCGI process and launches itself again after that. This > behaviour can be disabled by a global variable. > > I do not have any idea how to make neither 1.) nor 2.) work. How do I > detect if the user-agent send an force-reload/cache-ignore? I'm not sure that's the 'right way' - do you really want clients to tell your app when to restart? > I cannot make the last example on this Page: > http://rubygarden.org/ruby/ruby?FCGIRubyWhyArentMyChangesDisplayed > working yet... That should work. I did something similar (which it looks like I've since deleted) that killed itself if it's file had changed and let apache restart it. These days I use lighttpd running as myself to frontend my app, so I either restart it or kill the fcgi children myself and let lighty restart them. -- 'Terrify ants into believing they have been invaded by "War Of The Worlds" style\nMartians by standing 3 pin plugs on end around their holes."' -- J.T. Thropton. Rasputin :: Jack of All Trades - Master of Nuns