cancel
Showing results for 
Search instead for 
Did you mean: 
dave_seddon_201
Nimbostratus
Nimbostratus

Problem this snippet solves:

Description of HTTP1.1 Cache-control headers and how to manipulate them with iRules, including case by case examples. Regards, Dave Seddon dave@seddon.ca

Code :

# Remove Cache-Control Headers 

when HTTP_RESPONSE { 
   # Remove all Cache-Control related headers 
   HTTP::header remove Cache-Control 
   HTTP::header remove Expires
   HTTP::header remove Pragma  
}

# Replace Cache-Control Headers - This will cache for 5 minutes 

when HTTP_RESPONSE { 
   # Remove all Cache-Control related headers 
   HTTP::header replace Cache-Control public,max-age=300
   HTTP::header remove Expires
   HTTP::header remove Pragma  
}

# Replace Cache-Control Headers - This will NOT cache 

when HTTP_RESPONSE { 
   # Remove all Cache-Control related headers 
   HTTP::header replace Cache-Control private,no-cache,no-store,max-age=0
   HTTP::header replace Expires -1
   HTTP::header replace Pragma no-cache
}
Version history
Last update:
‎16-Mar-2015 15:48
Updated by:
Contributors