QuestionQ94Verified/Identify and Resolve LTM Device IssuesCopy linkReport a problemAsk AstroTutorSave questionWhich iRule instructs the client’s browser not to cache HTML responses from the server?Awhen 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" } }Bwhen 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" } }Cwhen 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" } }Dwhen 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" }Show AnswerAnswerExplanationBrowser cache directives must be inserted or replaced in the server response, which is handled by the HTTP_RESPONSE event. HTML responses normally use a Content-Type such as text/html and may include additional parameters, so a contains "html" condition correctly identifies them. The Pragma, expired Expires, and Cache-Control: no-cache,no-store,must-revalidate headers direct the browser not to cache the response.Learn moreF5 iRules HTTP_RESPONSE event referenceF5 iRules STREAM::expression examplesShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion