View Single Post
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 12-07-2016 , 12:50   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #34

A small tip I just realized: Most web servers will do this automatically, but if you gzip your web files then you'll get faster page loads. Just be sure to add the proper WebResponse header.

Code:
BuildPath(Path_SM, path, sizeof(path), BASE_PATH ... "vtflib.js.gz");
webVTFlib = new WebFileResponse(path);
webVTFlib.AddHeader(WebHeader_ContentType, "text/javascript");
webVTFlib.AddHeader(WebHeader_CacheControl, "public, max-age=2629740");
webVTFlib.AddHeader(WebHeader_ContentEncoding, "gzip");
From 600 kb to 100 kb in this case. Good stuff!
__________________

Last edited by GoD-Tony; 12-08-2016 at 04:53.
GoD-Tony is offline