Forum Discussion
Question about If-Modified-Since HTTP header
Hi all,
I am running in something I cannot explain at this time, so any help would be greatly appreciated. Seems I do not understand the HTTP headers If-Modified-Since and If-None-Match 🙂
I initially wanted to get the values of these headers, but since that was void, I just decided to check if they simply exist and log the result. Seems they don't. But when checking the http capture whether in tcpdump or Fiddler, I can see those 2 headers are present...
What am I missing about the behavior of these headers ?
Here is my very basic iRule
when HTTP_REQUEST {
if {[HTTP::header exists "If-Modified-Since"] } {
set ims 100
set inm 100
}
else {
set ims 0
set inm 0
}
log -noname local0. "My IMS est : $ims and my INM : $inm"
}
and the data capture : Thanks !
6 Replies
- Kevin_Stewart
Employee
The If-Modified-Since and If-None-Match headers are used for cache control. Did you want to do something particular with these two headers?
So if you do this, what do you see?
when HTTP_REQUEST { if { [HTTP::header exists If-Modified-Since] } { log local0. "If-Modified-Since exists: [HTTP::header If-Modified-Since]" } if { [HTTP::header exists If-None-Match] } { log local0. "If-None-Match exists: [HTTP::header If-None-Match]" } }
- What_Lies_Bene1
Cirrostratus
Sorry to resond with a question but can you tell me what the '-noname' option on your log command does please? - Kevin_Stewart
Employee
The -noname option suppresses the name of the iRule in the log. https://devcentral.f5.com/wiki/iRules.log.ashx - InnO
Nimbostratus
Thx Kevin. Running this iRule, nothing happens, it seems headers just do not exist... I can get and log any other header, but these 2 ones are just escaped...
I do not really want to do something with these headers. The thing is I just want to understand why I have that happening...
- Kevin_Stewart
Employee
Do you by chance have a web acceleration profile applied to the VIP?
- Kevin_Stewart
Employee
Also, try this:
when HTTP_REQUEST { foreach x [HTTP::header names] { log local0. "request header ($x): [HTTP::header $x]" } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com