Here's an old detailed example of what it appears you are trying to accomplish. I've swapped out the findclass command (deprecated in v10+) with the class command:
when HTTP_REQUEST {
if {[HTTP::method] eq "GET" and [HTTP::uri] eq "/"}{
set expire_content_timeout 300
} else {
set extention [string tolower [string range [HTTP::path] [string last . [HTTP::path]] end]]
set expire_content_timeout [class match -value $extention equals cache_timers_by_filetype]
}
}
when HTTP_RESPONSE {
if { $expire_content_timeout ne "" } {
HTTP::header replace "Cache-Control" "max-age=$expire_content_timeout, public"
HTTP::header replace "Expires" "[clock format [expr ([clock seconds]+$expire_content_timeout)] -format "%a, %d %h %Y %T GMT" -gmt true]"
} else {
HTTP::header replace Expires {-1}
}
}
The data-group format from that old example has changed as well:
ltm data-group internal cache_timers_by_filetype {
records {
.bmp {
data 86400
}
.css {
data 3600
}
.gif {
data 86400
}
.htm {
data 300
}
.html {
data 300
}
.ico {
data 604800
}
.jpeg {
data 86400
}
.jpg {
data 86400
}
.js {
data 3600
}
.pdf {
data 604800
}
.png {
data 86400
}
.swf {
data 604800
}
}
type string
}