Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xabbuh opened this issue May 19, 2015 · 2 comments
Closed
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required) hasPR A Pull Request has already been submitted for this issue. HttpFoundation

Comments

@xabbuh
Copy link
Member

xabbuh commented May 19, 2015

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.

@xabbuh xabbuh added good first issue Ideal for your first contribution! (some Symfony experience may be required) actionable Clear and specific issues ready for anyone to take them. HttpFoundation labels May 19, 2015
@dupuchba
Copy link

Good catch !

@kherge
Copy link
Contributor

kherge commented Jun 1, 2015

Created a PR!

Let me know if the wording could be better.

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Jun 3, 2015
weaverryan added a commit that referenced this issue Oct 15, 2015
…ileResponse. (kherge)

This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #5345).

Discussion
----------

Adding information about empty files sent using BinaryFileResponse.

Updating documentation to account for weird scenario described in #5268.

Commits
-------

aa2ac55 Adding information about empty files sent using BinaryFileResponse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required) hasPR A Pull Request has already been submitted for this issue. HttpFoundation
Projects
None yet
Development

No branches or pull requests

4 participants