F5 BIG-IP LTM Specialist: Maintain and Troubleshoot — Question 69
Which iRule will instruct the client's browser to avoid caching HTML server responses?
Answer options
- A. when HTTP_REQUEST { if {[HTTP::header Content-Type] equals "html"} { HTTP::header insert Pragma "no-cache" HTTP::header insert Expires "Fri, 01 Jan 1990 00:00:00 GMT" HTTP::header replace Cache-Control "no-cache,no-store,must-revalidate" } }
- B. when HTTP_REQUEST { if {[HTTP::header Content-Type] contains "html"} { HTTP::header insert Pragma "no-cache" HTTP::header insert Expires "Fri, 01 Jan 1990 00:00:00 GMT" HTTP::header replace Cache-Control "no-cache,no-store,must-revalidate" } }
- C. when HTTP_RESPONSE { if {[HTTP::header Content-Type] contains "html"} { HTTP::header insert Pragma "no-cache" HTTP::header insert Expires "Fri, 01 Jan 1990 00:00:00 GMT" HTTP::header replace Cache-Control "no-cache,no-store,must-revalidate" } }
- D. when HTTP_RESPONSE { if {[HTTP::header Content-Type] equals "html"} { HTTP::header insert Pragma "no-cache" HTTP::header insert Expires "Fri, 01 Jan 1990 00:00:00 GMT" HTTP::header replace Cache-Control "no-cache,no-store,must-revalidate" }
Correct answer: C
Explanation
The correct answer, C, uses the HTTP_RESPONSE event, which is appropriate for modifying headers in server responses. Options A and B incorrectly use the HTTP_REQUEST event, which is meant for incoming requests, while D incorrectly checks for an exact match instead of using the 'contains' method, which is more flexible for checking content types.