On Thu, Aug 25, 2011 at 9:22 AM, Clint Willard <clint...@gmail.com> wrote:

> Quick glance I'd say listFindNoCase(searchTermList,cgi.http_user_agent).
> Put the search terms in a list to find.
>

This will only work if the entire exact case-less user agent matches an item
in the list.  I don't think it will solve Derrick's
problem. listFindNoCase('badbot version 30','badbot,jokerbot,sillybot') will
return false.

In a perfect world, I second Mark's suggestion of .htaccess.  The further up
the stack you can move this, the better.  Move it all the way to the
firewall if you can.  Takes load off the CF engine.  I'm not sure that works
for you either though, since you aren't blocking them, sounds like you are
just modifying the session timeouts and such on those requests.

I think looping over the values in CF is probably your best option.  Looping
over a list, or converting that list to an Array and caching the array might
be slightly faster.  I wouldn't be too worried about speed unless it's
deemed a problem.  Almost certainly there is another bottleneck worth
fretting over more than the 10ms a list loop might be adding to each
request.

List loops do get increasingly slower the longer they get because of the way
CF parses lists though, So keep it in the back of your mind for a future
optimization.  You know, like when they list reaches a few hundred items, or
you are getting a billion pageviews a day.

I remember Hal Helms saying the three laws of optimization during an ACFUG
meeting years ago:

1) Don't optimize yet
2) Don't optimize yet
3) Don't optimize yet

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook <http://www.facebook.com/cameroncf> |
twitter<http://twitter.com/cameronc> |
google+ <https://profiles.google.com/u/0/117829379451708140985>

Reply via email to