Forum Discussion

trx's avatar
Jun 15, 2011

switch not recognizing content type

Hello All,

 

For some reason my switch is NOT working correctly.

 

 

 

ex)

 

when HTTP_RESPONSE {

 

 

 

if request is a static file, set cache control to be cached on the client machine for 7 days

 

if { [HTTP::header exists Content-Type] } {

 

switch -glob [HTTP::header Content-Type] {

 

"text/javascript" -

 

"text/css"-

 

"image/gif" -

 

"image/jpeg" } {

 

HTTP::header replace "Cache-Control" "private, max-age=604800"

 

}

 

}

 

 

 

 

}

 

 

 

Any thoughts why this is happening?

 

 

 

Regards,

 

TRX