added cache control as an option, added gzip compression support