Forum Discussion
hooleylist
Aug 17, 2012Cirrostratus
If you have that many strings to check, I'd create a string data group (filetypes_dg in the example below) and replace the switch statements with a class match. Also as someone recently pointed out, if you're sending a 200 response with content you don't want cached or indexed you might want to set cache-control headers:
From: https://devcentral.f5.com/wiki/iRules.class.ashx
set match [class match -value -- [HTTP::path] ends_with filetypes_dg]
if {$match eq ""}{
HTTP::respond 200 content {
Apology Page
We are sorry, but the document you are attempting to access is restricted by Corporate Policy.
If you feel you have reached this page in error, please contact your supervisor.
} Pragma no-cache cache-control no-cache
}
Aaron