To handle mis-behaving bots I handle them with the simple code below, which works pretty well but it seems to be filling the requestlog with hits showing as taking over 10 seconds to process. Other than setting the requestlog to only save errors, is there a better way to handle this so it doesn't fill the requestlog with hits that appear to take a long time?
In wwstore::onprocessinit
if throttle()
response.status = [429 Too Many Requests]
response.end()
nodefault
retu .f.
endif
Thanks in advance for any suggestions!!
Where are you doing this check?
You should be doing this in OnProcessInit()
to avoid running your actual requests.
Another option is this: Don't do it in FoxPro, but write a small .NET HttpModule that scans incoming requests for bots. If you can identify the bots (based on URLs or headers) then you can filter these requests out before they ever get to Web Connection which is much more efficient.
If you search around you might actually find some code for this. ASP.NET can work with code that's simply placed in a specific folder so no explicit compilation is required.
+++ Rick ---