Forum Discussion

ARUN_REDDY_6445's avatar
ARUN_REDDY_6445
Icon for Nimbostratus rankNimbostratus
Oct 28, 2010

iRule to cache extentions in uri after cahce::age > 60

This is bringing my site down please help me if there is something I can do with this please.

 

 

 

Created a Datagroup called extension_images and added ".jpg" ".gif" ".css" using iRule editor

 

 

 

when HTTP_REQUEST {

 

if { {[matchclass [HTTP::uri] ends_with $::extension_images]} && {[CACHE::age] > 60} }

 

{

 

CACHE::enable

 

}

 

}

 

 

 

Class extension_images has been created in Datagroups (gui). The if condition tests for 2 conditions First for the extension and the second for the browser time that has holded the class filetypes greater than 60 seconds. If the condition is true the F5 trigers the host to cache the class filetypes.

 

 

 

  • This will definitely break everything unless you have RAM cache enabled for the HTTP profile you are using. Careful enabling this though as it will default to cache everything (bad if you have a dynamic site) unless you specify the proper cache exclusions in the HTTP profile.

     

     

    I'm not sure "CACHE::age" is doing what you think it is doing. CACHE::age (http://devcentral.f5.com/wiki/default.aspx/iRules/CACHE__age.html) returns the current age of the cache (on the F5) not the browser.