Skip to content

Use X-Accel-Redirect instead of readfile to serve originals faster #352

Description

@ericek111

A lot of CPU time could be saved by redirecting to the original file internally in nginx/Apache without streaming the file through PHP:

if (@readfile($filename) === false) {

https://idiallo.com/blog/making-php-as-fast-as-nginx-or-apache
This is natively supported in nginx through the X-Accel-Redirect header. Apache needs a small 3rd party module, mod_xsendfile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions