Now I read RFC 2616 the content-encoding need to be specified as x-gzip. Also i am not sure whether the fact that it is registered with IANA exempt us from adding it to html header. The corrected patch below.