On Monday, June 11, 2012 12:42:47 AM UTC-4, Anthony wrote: > > What I am hearing is that even the 'reload routes' button is not safe >> to use on a busy server. > > > Yes, but it's a fairly general problem, not specific to the web2py rewrite > system. Let's say someone loads a page from your projectX2011 app and > leaves the page open for a while. While they have the page open, you > redirect all /projectX links from projectX2011 to projectX2012. If the user > then clicks one of the links on the page (or if the page makes an Ajax > request), the new request will go to projectX2012, even though the original > page was from projectX2011. This is a problem whether you use symbolic > links, web2py rewrite, Apache mod_rewrite, or any other method. The issue > could probably be addressed, but it would get tricky (maybe track IP > addresses and route requests to the old app if from an IP address that has > made a request within some earlier window of time). >
I notice the Google Groups web interface periodically flashes a message saying there's a new version of the application and prompting to reload the page to get the new application. I suppose you could do something like that using Javascript and server polling. Assuming you don't change the routing too often, maybe whenever you're getting ready to make a change, start sending some Javascript code with every page (maybe an hour before the change). Have the code periodically poll the server via Ajax to check whether the change has been made. Once the change has been made, flash a message on the page prompting the user to reload the page for the updated application (or possibly just auto reload the page via Javascript if it won't cause the user to lose any work). You don't need the special Javascript and polling all the time -- just during a window of time around the routing change. Anthony

