Forum Discussion
Want to display a maintenance page from the F5 using ifile + irule and no cache.
Hi experts, we are running ver 11.5.1 hf3 on our LTMs. I am using the ifile feature to send out a maintenance page by using the below irule -
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { HTTP::respond 200 content [ifile get MY-HTML-IFILE] } }
My problem is, i want to insert the no cache, no store headers with it to avoid any kind of caching on the browsers. When i add this line in the irule and test, it breaks the VS - HTTP::header insert Cache-Control "no-store, no-cache"
How can i accomplish this?
4 Replies
- Vernon_97235Historic F5 Account
in the HTTP_REQUEST event inserts the headers in the request before passing the request to the forwarding target (generally a pool member). Since you are not passing the request along, that's not quite what you want.HTTP::header insertThe HTTP::respond command allows you to insert headers directly on the response:
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { HTTP::respond 200 content "[ifile get MY-HTML-IFILE]" noserver "Cache-Control" "no-store, no-cache" } }- sandy16
Altostratus
Thanks... that works !! You are bang on target !!
- VernonWells
Employee
in the HTTP_REQUEST event inserts the headers in the request before passing the request to the forwarding target (generally a pool member). Since you are not passing the request along, that's not quite what you want.HTTP::header insertThe HTTP::respond command allows you to insert headers directly on the response:
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { HTTP::respond 200 content "[ifile get MY-HTML-IFILE]" noserver "Cache-Control" "no-store, no-cache" } }- sandy16
Altostratus
Thanks... that works !! You are bang on target !!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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