anchor.diff:    end;
   
   begin
  -  if AResponseContext.Request.AcceptableEncodings.Contains(ENC_DEFLATE) then
  +  if AResponseContext.Request.AcceptableEncodings.Contains(ENC_GZIP)
  +    then LContentEncoding := ENC_GZIP
  +    else
  +  if AResponseContext.Request.AcceptableEncodings.Contains(ENC_DEFLATE)
  +    then LContentEncoding := ENC_DEFLATE
  +    else LContentEncoding := ENC_IDENTITY;
  +
  +  if LContentEncoding <> ENC_IDENTITY then
     begin
       if Assigned(AResponseContext.Response.ContentStream) then
       begin
  -      LMemStream := TFileStream.Create(TPath.Combine(TPath.GetDocumentsPath, 'sample.' + ENC_DEFLATE), fmCreate);
  -      try
  -        DoCompress(AResponseContext.Response.ContentStream, LMemStream);
  +      LMemStream := TFileStream.Create(TPath.Combine(TPath.GetDocumentsPath, 'sample.' + LContentEncoding), fmCreate);
  +      try
  +        DoCompress(AResponseContext.Response.ContentStream, LMemStream, LContentEncoding);
           LMemStream.Position := soFromBeginning;
           AResponseContext.Response.ContentStream := LMemStream;
         except
           LMemStream.Free;
         end;
  -      AResponseContext.Response.ContentEncoding := ENC_DEFLATE;
  +      AResponseContext.Response.ContentEncoding := LContentEncoding;
       end
       else if AResponseContext.Response.Content <> '' then
       begin
         LStrStream := TStringStream.Create(AResponseContext.Response.Content);
         LStrStream.Position := soFromBeginning;
         try
  -        LMemStream := TFileStream.Create(TPath.Combine(TPath.GetDocumentsPath, 'sample.' + ENC_DEFLATE), fmCreate);
  +        LMemStream := TFileStream.Create(TPath.Combine(TPath.GetDocumentsPath, 'sample.' + LContentEncoding), fmCreate);
           try
  -          DoCompress(LStrStream, LMemStream);
  +          DoCompress(LStrStream, LMemStream, LContentEncoding);
             LMemStream.Position := soFromBeginning;
             AResponseContext.Response.Content := '';
             AResponseContext.Response.ContentStream := LMemStream;
  
positive.code:       finally
          LStrStream.Free;
        end;
        AResponseContext.Response.ContentEncoding := ENC_DEFLATE;
      end;
    end;
  end;
  
negative.code:   end;
  
  begin
    if (ARequestContext.Request.ContentEncoding = ENC_GZIP)  or
      (ARequestContext.Request.ContentEncoding = ENC_DEFLATE) then
    begin
      if Assigned(ARequestContext.Request.ContentStream) then
      begin
        LMemStream := TMemoryStream.Create;
        try
          DoDecompress(ARequestContext.Request.ContentStream, LMemStream,
            ARequestContext.Request.ContentEncoding);
          LMemStream.Position := soFromBeginning;
          ARequestContext.Request.ContentStream := LMemStream;
        except
  