Project

General

Profile

Actions

Feature proposal #6960

closed

Implement smart file chunking

Added by krileon about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
Start date:
03 January 2018
Due date:
% Done:

100%

Estimated time:

Description

Currently files are always output to the buffer in chunks. This basically allows serving unlimited size files without hitting PHP memory limits. However, chunking a file does increase its load time. File chunking isn't necessary on smaller files (e.g. anything less than 512kb should be fine) so it's resulting in images or smaller files being output to buffer SLIGHTLY slower (couple milliseconds). Implement smart buffering so it doesn't need to bother doing this for smaller files.

In addition to this fopen with fseek is always used even if there is no range request. If the file is smaller and no range then readfile can be used to just directly push to buffer a little faster.

Actions #1

Updated by krileon about 6 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100
Actions #2

Updated by krileon about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF