Skip to content

Conversation

@lukasvalle
Copy link

The intention of this PR is to show, that cro-http and the IO::Handle.Supply core functionality would work nice together to implement something similar to sendfile_max_chunk in nginx to reduce memory consumption when delivering large files.

This PR includes:

  • test for Content-length for static served files for the existing implementation
  • test for Content-length and content for chunk served files
  • a named parameter chunk_size for the static sub
  • a named parameter content_length for Supply BodySerializer and the Router content method to set the content_length header field for chunk deliverd content

…ould reduce memory usage when serving large files. Using Supply is a common pattern in cro in general. The rakudo default size makes the downloads a lot slower than server it from memory. 1MB is better. But what would be a sensible size for the chunks?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant