There has been some thought about moving DoVisit to before (or even during) DoRequest. The benefit of this would be that when the site administrator views the 'visitors' action from the administrative menu, the list would be completely up to date (as it is right now, it will not show the current request).
However, due to the way DoVisit works, I'm leaning heavily against this. DoVisit will attempt to get an exclusive lock on the $VisitorLog before it attempts to write to it. If it can't obtain a lock, then it will wait until it can. I implemented this so that even on very busy sites, every visit would be captured.
The reason I want DoVisit to run after DoRequest is due to the (perceived) speed decrease that would cause. Aneuch since version 0.30 has not buffered its output, meaning when it sends out data it is sent out right away. This translates to a fast display of the requested page. If DoVisit is called before the page data is displayed, and the site is very busy, the user will have to wait for his output until the exclusive lock is obtained, the visit data is written to the log, and the file is closed. Though the total time for the visit is the same, it's perceived to be faster if DoVisit is run after DoRequest (since the output will be shown on the screen, the user will not really know that the script is stalled waiting to write to $VisitorLog).
-- AaronGraves Mon Aug 12 17:00:42 UTC 2013 (22.214.171.124)
There will be some rather large changes to the script flow in release 0.30 that will be documented here.
-- AaronGraves Thu Aug 29 01:58:38 UTC 2013 (126.96.36.199)