Skip to content

Allow to specify ranges for partial loading #33

@Fuzzyma

Description

@Fuzzyma

Sometimes it might be useful to load only parts of a file. Hence it might be useful to allow for ranges to be specified.

Something along the lines of:

import bytes from "./photo.png" with { type: "bytes", range: { from: 0, to: 500 } };

or

import bytes from "./photo.png" with { type: "bytes", offset: 500, length: 1000 };

or

import bytes from "./photo.png" with { type: "bytes", slice: [500, 1000] };

The Browser would then load the file via a range request.
Some servers might now support this. In that case, they usually just send the whole file which is a reasonable fallback in most cases but could lead to huge load times for scripts in this case. So not sure how to handle that...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions