Send gzip-compressed content added by mario-goulart on Sat May 4 15:40:54 2013

(use awful intarweb spiffy)

(define (send-gzipped-file file)
  (if (memq 'gzip (header-values 'accept-encoding
                                 (request-headers (current-request))))
      (with-headers `((content-encoding gzip))
        (lambda ()
          (send-static-file file)))
      (send-response
       code: 406
       body: "<h1>406 - Only gzip-compressed content is avalilable</h1>")))

(index-files
 (cons "index.htmlz"
       (index-files)))
        
(mime-type-map
 (append (mime-type-map)
         `(("htmlz" . text/html))))

(file-extension-handlers
 `(("sgvz"  . ,send-gzipped-file)
   ("htmlz" . ,send-gzipped-file)))