support gzip and nocompress mode.