From d5db02603ac8cc0caf995fe65e18232a617a68f1 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 6 Aug 2014 10:46:27 +0100 Subject: [PATCH] meta/new-web: use `--web` mode of `raco s3-sync` A side effect of this change is that ".html" files bigger than 1k are gzipped, in addition to ".css" and ".js" files. I find several web comments to the effect that gziping ".html" files works fine, because all browsers support it, and no warnings against. Since gzipping ".css" and ".js" files has worked fine for us, too, lets take the plunge and try gzipping ".html". --- pkgs/plt-services/meta/new-web/sync.rkt | 28 +++++++++---------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/pkgs/plt-services/meta/new-web/sync.rkt b/pkgs/plt-services/meta/new-web/sync.rkt index 434901aa24..ee520081d0 100644 --- a/pkgs/plt-services/meta/new-web/sync.rkt +++ b/pkgs/plt-services/meta/new-web/sync.rkt @@ -20,7 +20,7 @@ ;; Manually check package install and version: (define s3-sync-pkg "s3-sync") -(define min-s3-sync-vers "1.1") +(define min-s3-sync-vers "1.3") (require pkg/lib setup/getinfo version/utils) @@ -36,8 +36,7 @@ "please update the ~s package to get version ~a or later" s3-sync-pkg min-s3-sync-vers)))) -(require s3-sync - s3-sync/gzip) +(require s3-sync/web) (define (step . s) (displayln (make-string 72 #\=)) @@ -59,23 +58,16 @@ (dynamic-require 'meta/new-web/all #f) (dynamic-require '(submod meta/new-web/all main) #f)) -(define-values (gzip-web-in gzip-web-enc) - (make-gzip-handlers #rx"[.](css|js)$" #:min-size (* 1 1024))) - (define (upload dir site #:shallow? [shallow? #f]) (step (format "Uploading ~a" site)) - (s3-sync (build-path "generated" dir) - site - #f - #:dry-run? dry-run? - #:shallow? shallow? - #:upload? #t - #:reduced-redundancy? #t - #:acl "public-read" - #:link-mode 'redirect - #:make-call-with-input-file gzip-web-in - #:get-content-encoding gzip-web-enc - #:log displayln)) + (s3-web-sync (build-path "generated" dir) + site + #f + #:dry-run? dry-run? + #:shallow? shallow? + #:upload? #t + #:link-mode 'redirect + #:log displayln)) (upload "www" "racket-lang.org") (upload "www" "www.racket-lang.org") (upload "pre" "pre.racket-lang.org")