Disable Partial GET Requests for RAM Cache

Problem this snippet solves:

A side effect of using RAM Cache is that partial GET requests (206 Partial Content - see RFC 2616 sections 10.2.7 and 14.35) is enabled by BIG-IP for objects available in RAM Cache, even if the server that produced the content did not support partial GET. While partial GET requests are usually a benefit in terms of bandwidth, some applications (such viewing PDF documents with Adobe Reader) react poorly when the browser (such as Internet Explorer) attempts to make use of this capability. Here is an iRule that disables partial GET requests by removing the "Accept-Ranges" header that advertises it. The example can be expanded upon to disable partial GET requests only for certain conditions (such as the URI path ends in ".pdf").

Code :

when CACHE_RESPONSE {
   HTTP::header remove "Accept-Ranges"
}
Published Jan 30, 2015
Version 1.0