diff options
-rw-r--r-- | guix-data-service/web/compare/controller.scm | 3 | ||||
-rw-r--r-- | guix-data-service/web/render.scm | 16 |
2 files changed, 13 insertions, 6 deletions
diff --git a/guix-data-service/web/compare/controller.scm b/guix-data-service/web/compare/controller.scm index 901b4f9..e1fab78 100644 --- a/guix-data-service/web/compare/controller.scm +++ b/guix-data-service/web/compare/controller.scm @@ -748,7 +748,8 @@ (valid-targets->options targets) build-status-strings build-server-urls - derivation-changes)))))))))))) + derivation-changes) + #:stream? #t))))))))))) (define (render-compare-by-datetime/package-derivations mime-types query-parameters) diff --git a/guix-data-service/web/render.scm b/guix-data-service/web/render.scm index 1ec47ac..90f577e 100644 --- a/guix-data-service/web/render.scm +++ b/guix-data-service/web/render.scm @@ -139,17 +139,23 @@ #f))) (define* (render-html #:key sxml (extra-headers '()) - (code 200)) + (code 200) + stream?) (list (build-response #:code code #:headers (append extra-headers '((content-type . (text/html (charset . "utf-8"))) (vary . (accept))))) - (call-with-encoded-output-string - "utf-8" - (lambda (port) - (sxml->html sxml port))))) + (if stream? + (lambda (port) + (set-port-encoding! port "utf-8") + (setvbuf port 'block (expt 2 20)) + (sxml->html sxml port)) + (call-with-encoded-output-string + "utf-8" + (lambda (port) + (sxml->html sxml port)))))) (define* (render-json json #:key (extra-headers '()) (code 200) |