Home      Updates      RSS Feed      About      Code      Contact

  gzip all the things! July 31 2011 10:05 AM EST

I found out the proper way to tell the web browser that we're serving gzipped files. So, now the bigger files (all related to jquery) are gzipped and served that way. I've been updating dsrv to be more robust about serving files that actually exist. Previously, there was a special case for each file I wanted to actually serve off the file system. Now, we instead look to see if the requested file exists and is of a certain type. We dump the headers, and then the file and exit. This gzipping logic just checks to see if on top of the requested file existing if the same URL with .gz appended exists. If it does, we let the browser now the encoding is gzip and dump the compressed file instead.

One of the improvements I hope to make to dsrv soon is to properly use content expiry dates to get the browser to cache things. For instance, all the jquery stuff shouldn't change that often. Another time, perhaps.

 

My name is Jeff Chapman; You can reach me at: [email protected]