anchor.diff:                                 CMeta ++ Headers ++ CustomHeaders
                          end,
   
  -            BodyFunc = fun(Socket, Transport) ->
  -                               leo_net:chunked_send(
  -                                 Transport, Socket, CacheObj#cache.body, SendChunkLen),
  -                               ?access_log_get(BucketName, Key, CacheObj#cache.size, ?HTTP_ST_OK, BeginTime, "hit:mem-cache")
  -                       end,
  -
  -            ?reply_ok(Headers2, {CacheObj#cache.size, BodyFunc}, Req);
  +            case can_gzip(Req) of
  +                true ->
  +                    ?access_log_get(BucketName, Key, CacheObj#cache.size, ?HTTP_ST_OK, BeginTime, "hit:mem-cache"),
  +                    ?reply_ok(Headers2, CacheObj#cache.body, Req);
  +                false ->
  +                    BodyFunc = fun(Socket, Transport) ->
  +                                       leo_net:chunked_send(
  +                                         Transport, Socket, CacheObj#cache.body, SendChunkLen),
  +                                       ?access_log_get(BucketName, Key, CacheObj#cache.size, ?HTTP_ST_OK, BeginTime, "hit:mem-cache")
  +                               end,
  +                    ?reply_ok(Headers2, {CacheObj#cache.size, BodyFunc}, Req)
  +            end;
   
           %% MISS: For the case If-Modified-Since matches timestamp in metadata
           {ok, #?METADATA{timestamp = IMSSec}, _Resp} ->
  
positive.code:                  true ->
                       [{env, [{dispatch, Dispatch}]},
                        {max_keepalive, MaxKeepAlive},
                        {timeout, Timeout4Header}];
                   %% Using http-cache (like a varnish/squid)
                   false ->
  
negative.code:                                                        sending_chunked_obj_len = SendChunkLen},
                       [{env, [{dispatch, Dispatch}]},
                        {max_keepalive, MaxKeepAlive},
                        {compress, true},
                        {onrequest, Handler:onrequest(CacheCondition)},
                        {onresponse, Handler:onresponse(CacheCondition)},
                        {timeout, Timeout4Header}]
  