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: var
    LStrStream: TStringStream;
    LMemStream: TFileStream;
  
    procedure DoCompress(ASource, ADestination: TStream);
    var
      LCompressor: TZCompressionStream;
    begin
      ASource.Seek(0, TSeekOrigin.soBeginning);
  
      LCompressor := TZCompressionStream.Create(clDefault, ADestination);
      try
        LCompressor.CopyFrom(ASource, ASource.Size);
      finally
  
negative.code: var
    LStrStream: TStringStream;
    LMemStream: TMemoryStream;
    LContentEncoding: string;
  
    procedure DoCompress(ASource, ADestination: TStream;
      const AContentEncoding: string);
    var
      LWindowBits: Integer;
      LCompressor: TZCompressionStream;
    begin
      LWindowBits := 15;
      if AContentEncoding = ENC_GZIP
        then Inc(LWindowBits, 16); //REF: https://stackoverflow.com/a/52815667/8018798
  
      ASource.Seek(0, TSeekOrigin.soBeginning);
      LCompressor := TZCompressionStream.Create(ADestination, zcDefault, LWindowBits);
      try
        LCompressor.CopyFrom(ASource, ASource.Size);
      finally
  