Skip to content

[HttpFoundation] Explain the impact of the stat cache on the BinaryFileResponse #5268

Closed
@xabbuh

Description

@xabbuh

The result of a filesize() call as well as a call to SplFileInfo::getSize() are cached to improve speed. However, as the BinaryFileResponse relies on the getSize() method to return a proper HTTP response, it must be ensured that clearstatcache() is called before the response will be returned.

For example, this behaviour led to some confusion in symfony/symfony#11102.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HttpFoundationactionableClear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions