From b129adf4a41febae26059ed9b2ffb256499c378e Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 28 Feb 2016 22:04:03 -0800 Subject: [PATCH] Increase FileResponse chunk size for staticfiles handler --- channels/staticfiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channels/staticfiles.py b/channels/staticfiles.py index 8169be8..153226d 100644 --- a/channels/staticfiles.py +++ b/channels/staticfiles.py @@ -49,7 +49,10 @@ class StaticFilesHandler(AsgiHandler): if self._should_handle(request.path): try: - return self.serve(request) + response = self.serve(request) + # Increase FileResponse block sizes so they're not super slow + response.block_size = 1024 * 256 + return response except Http404 as e: if settings.DEBUG: from django.views import debug