We have a few thousand catalogs with pages that are accessed up to a half a million times each day. At the end of every page hit, we insert some of the CGI variables into a database. If a form was submitted or a search was performed, we insert some of that information to another database. No information needs to be returned from each of these database inserts. These inserts happen at the end of the page processing.
I've read that once a "run" thread is launched page processing continues and doesn't wait for a response. This seems like it would speed up the page being complete because it's not waiting for the queries in the pages to run. Is this correct?
Is there any benefit to putting these database inserts into their own thread like this?
<cffunction
name="OnRequest"
access="public"
returntype="void"
output="true"
hint="Fires after pre page processing is complete.">
<cfargument name="RequestedContent" type="string" required="true" />
<!--- OUTPUT THE PAGE CONTENT --->
<cfinclude template="#ARGUMENTS.RequestedContent#" />
<cfscript>
thread
action="run"
name="Tracking" {
include "track1.cfm";
include "track2.cfm";
}
</cfscript>
<cfreturn />
</cffunction>