Page returns a Content Encoding error

book

Article ID: 166748

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

A website or page is returning a content encoding error.

Resolution

 This issue is typically caused by the origin content server (OCS) presenting a content encoding header of one type, but then encoding the data differently.

Workaround: Remove the Accept-Encoding header from outbound responses. The OCS administrator should also be made aware that they are delivering incorrect data.

The following are three ways to work around the issue:

Method 1 - Modify the Accept-Encoding header via policy.

  1. Add a new rule at the top of the web access layer.
  • Destination: Create a URL object that does a simple match on "domain.com," where "domain.com" is the site that you are having issues with.
  • Action field: Set  > New > Action field > Suppress headers > Select Request radio button> Accept-Encoding > Click OK.
  1. Install policy.

This will have the affect of removing/suppressing the client/browser's request header Accept-Encoding.

 Method 2 - Bypass cache for this site.

1. Add a new rule at the top of the web access layer.

  • Destination: Create a URL object that does a simple match on "domain.com," where "domain.com" is the site that you are having issues with.
  • Action field: Set - Bypass Cache, from the list - Click OK.

2. Install policy

This will have the affect of removing/supressing the client/browser's request header Accept-Encoding. 

Method 3 - Use a bypass cache CPL.

Install the following CPL:

<Cache>
    url.domain="domain.com" cache(no)

 

Example CPL:

define condition ContentEncodingIssue
url.domain="domain.com"
end

define action SuppressAcceptEncoding
    delete(request.header.Accept-Encoding)
end action SuppressAcceptEncoding

<Proxy>
condition=ContentEncodingIssue action.SuppressAcceptEncoding(yes)
   
<Proxy>
condition=ContentEncodingIssue bypass_cache(yes)

<cache>
condition=ContentEncodingIssue cache(no)