Forum Discussion

Wil_Schultz_101's avatar
Wil_Schultz_101
Icon for Nimbostratus rankNimbostratus
Feb 12, 2007

How can I grab an HTTP header on CACHE_REQUEST?

I'm trying to grab [HTTP::header "Content-Length"] to use during CACHE_REQUEST so I can make sure the BigIP does not cache blank pages. I've tried to set a global variable during HTTP::Response and no go. The closest I can seem to find would be to use [CACHE::headers] during CACHE_REQUEST.

What I'm using now, fugly...


when CACHE_REQUEST {
 set cheaders [CACHE::headers]
 if { $cheaders contains "Content-Length\: 0" } {
  log local0.$cheaders
  CACHE::expire
 }
}

What I would like to get closer to... Looks okay, but doesn't seem to work.


when CACHE_REQUEST {
 set cheaders [HTTP::header "Content-Length"]
 if { $cheaders == 0 } {
  log local1.$cheaders
  CACHE::expire
 }
}

Version 9.2.4

15 Replies