Forum Discussion
mrintzler
Feb 07, 2008Nimbostratus
You're exactly right. That was my problem. When I first implemented a version of this iRule, it was keyed off of the end-users IP address. Most of our customers will have the same IP address indefinitely, or at least for a long time. When I modified the iRule for a different application, I keyed the users by their session cookie, which changes each time they log in. As you pointed out, I only wipe their history from the array when they come back to download, so if a user comes back an hour later with a different session ID, their old entries in the array will be stuck their forever.
I've added the following code to periodically wipe the array. Since this is only to prevent extreme robotic abuse situations, it's ok to periodically lose the history for the previous 10 seconds:
if { $::totalPDF > $::refreshint } {
array unset ::pdfHistory
log local0. "$::refreshint downloads reached. Resetting array"
set ::totalPDF 0
}
Thanks for all the responses!