Skip to content

Document using IO objects / compression #711

@mperham

Description

@mperham

I'd like to generate a large blob of JSON and I also want to compress it at the same time. Right now I can do this:

json = JSON.generate(data)
result = Zlib.gzip(json)

Is it possible to avoid this intermediate variable and pass in a gzip IO so generation streams right into compression? Would it be reasonable to build in easy/efficient gzip integration, e.g. for streaming API/JSON responses with Content-Encoding: gzip?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions