unit Sparkle.Comp.CompressMiddleware;

interface

uses
  System.Classes,
  Sparkle.Comp.Server,
  Sparkle.HttpServer.Module,
  Sparkle.Middleware.Compress;

type
  TSparkleCompressMiddleware = class(TSparkleMiddleware)
  private
    FThreshold: Integer;
  protected
    function CreateMiddlewareInterface: IHttpServerMiddleware; override;
    class function GetDisplayName: string; override;
  public
    constructor Create(AOwner: TComponent); override;
  published
    property Threshold: Integer read FThreshold write FThreshold default 1024;
  end;

implementation

{ TSparkleCompressMiddleware }

constructor TSparkleCompressMiddleware.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FThreshold := 1024;
end;

function TSparkleCompressMiddleware.CreateMiddlewareInterface: IHttpServerMiddleware;
begin
  Result := TCompressMiddleware.Create;
end;

class function TSparkleCompressMiddleware.GetDisplayName: string;
begin
  Result := 'Compress';
end;

end.
