I want to reduce the overhead of spider/crawler traffic. I'm not expecting to catch all of it, but if I can catch 90% of it then it's a win.
What's the best way to conditionally turn on/off session or client management in application.cfc? I'm thinking something along the lines of this, but I'm not sure if the CGI scope is always defined and initialized when application.cfc is instantiated.
this.sessionManagement = !isSpiderRequest();
and:
private boolean function isSpiderRequest() {
if (REFindNoCase("googlebot|msnbot|crawler|crawling|spider|wget|curl|baidu|robot|slurp|Gigabot|ia_archiver|libwww-perl|lwp-trivial|Mediapartners-Google", CGI.HTTP_USER_AGENT))
return(true);
return(false);
}
We set the session timeout to 10 seconds for bots. They don't get errors, but don't consume any (much) memory.
Alternative answer... I haven't tried this, but I don't see why it won't work.