Depending on how long the list grows, you might see some performance
benefits in splitting your list so that you only search a subset of the
whole list each time. Maybe something like a list of names that contain
the letters "bot", other lists for names containing the word "spider" or
"crawler" or "cheapcasinocash." That way your app won't have to search
the entire list to find a match, but would only have to search a subset
of the list.
Ultimately though, I'd look at a .htaccess solution to redirect the bad
guys to a log file and a get lost sign while letting others through to
be logged.
There might also be a performance gain if the list(s) is stored as an
application variable so that it's always in memory and readily
available. I'm not sure about that. I hope a guru will correct me if I'm
wrong...
mf
On 8/25/2011 9:45 AM, Derrick Peavy wrote:
Aggh. Of course!!!
Why didn't I think of that? I seem to constantly forget about
listFindNoCase.
Thank you! Simplicity is best IMO.
__________________
Derrick Peavy
[email protected] <mailto:[email protected]>
404-786-5036
“Innovation distinguishes between a leader and a follower.” - Steve Jobs
"In economics, the majority is always wrong." - John Kenneth Galbraith
_____________________
On Aug 25, 2011, at 9:22 AM, Clint Willard wrote:
Quick glance I'd say
listFindNoCase(searchTermList,cgi.http_user_agent). Put the search
terms in a list to find.
*Clint Willard *
Senior ColdFusion Programmer Analyst
[email protected] <mailto:[email protected]>
h) 770-965-6074
m) 706-714-5502
On Wed, Aug 24, 2011 at 5:06 PM, Derrick Peavy
<[email protected] <mailto:[email protected]>> wrote:
Looking for a clever solution to this problem.
I have some code on a site that checks for known spiders/bots and
malicious user agents. The list of "known" is baout 50 or so long.
One solution could be:
(findNoCase('#searchTerm#', cgi.http_user_agent)) OR
(findNoCase('#searchTerm#', cgi.http_user_agent)) OR
(findNoCase('#searchTerm#', cgi.http_user_agent)) OR ... etc and
so on, 50 times.
Another solution could be:
<cfif findNoCase('#searchTerm#', cgi.http_user_agent)>do
something</cfif> and repeat that complete CFIF 50 times.
What is a creative way to solve this without so many IF's and
minimal processing?
Alos, the list of user agents can be either file based or pulled
from a DB. I've done it both ways and I have used both solutions
above. Don't see a difference, but it just seems rather crude.
__________________
Derrick Peavy
[email protected] <mailto:[email protected]>
404-786-5036 <tel:404-786-5036>
“Innovation distinguishes between a leader and a follower.” -
Steve Jobs
"In economics, the majority is always wrong." - John Kenneth
Galbraith
_____________________
--
mark fennell
athens regional medical center
athens, ga
----------
This email is intended only for the named recipient(s). It may contain
information that is proprietary, confidential or otherwise prohibited from
disclosure. If you are not the named addressee, you are not authorized to
read, print, retain, copy or disseminate this message or any part of it. If
you have received this message in error, please reply immediately by email or
telephone me at 706-475-4357 and delete all copies of the message. Furthermore,
the opinions and thoughts expressed herein do NOT represent the policies or
opinions of Athens Regional Health Services, Inc. (ARHS). ARHS is NOT
responsible for the thoughts and opinions expressed in this communication.
----------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------