Forum Discussion

Michael_Mangret's avatar
Michael_Mangret
Icon for Nimbostratus rankNimbostratus
Apr 11, 2007

V9 to V4 Irule conversion

Can someone please help me convert an irule from v9 to v4? I am unfamiliar with the syntax for irules on v4.

 

 

Here is the irule in v9...

 

 

 

when HTTP_REQUEST {

 

if {[string tolower [HTTP::header x-moz:] ] contains "prefetch" } {

 

HTTP::respond 403 content "Forbidden"}

 

else {set host_pool [findclass [HTTP::host] $::DSHostPoolMap " "] }

 

if { $host_pool ne "" } {

 

pool $host_pool }

 

}

 

 

Thanks in advance

 

 

Mike

2 Replies

  • I don't think you can send a 403 response back using an iRule in 4.x. This would be pretty straightforward in 9.x. If upgrading to 9.x isn't an option, you might try testing a rule that redirects prefetch requests to a sorry page.

     

     

    Else, a better option could be to use a robots.txt entry on your site which specifies FasterFox should not prefetch for your domain:

     

     

     

    http://fasterfox.mozdev.org/faq.html

     

     

    + I'm a webmaster, how can I prevent prefetching?

     

     

    Because some websites may not have the resources available to support the enhanced prefetching feature, it may be easily blocked by webmasters.

     

     

    Prior to generating any prefetching requests, Fasterfox checks for a file named "robots.txt" in your site's root directory (subdirectories are not checked). If this file contains the following 2 lines, no prefetching requests will be made to your domain:

     

     

    User-agent: Fasterfox

     

    Disallow: /

     

     

     

     

    Aaron