Skip to content

perf(raw): resolve the local path only for an offload - #232

Merged
ernolf merged 1 commit into
mainfrom
ernolf/perf/offload-local-path
Dec 2, 2026
Merged

ernolf merged 1 commit into
mainfrom
ernolf/perf/offload-local-path

Conversation

@ernolf

@ernolf ernolf commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Closes #230

  • returnRawResponse() first asks the configuration whether an offload can happen at all (raw_sendfile_backend, raw_sendfile_allow_private, raw_sendfile_min_size_mb) and resolves the local path of the file only then. Before, every request resolved it, also with the offload off.
  • tryResolveLocalPath() asks only a local storage. A storage that is not local (object store, server-side encryption, external storage) answers getLocalFile() with a temp copy of the whole file, which nothing used afterwards.
  • When the local path was sniffed already and the offload does not happen, the stream does not sniff again, and it no longer recomputes the MIME type of the node.
  • With the offload off, the debug header X-Raw-Offload now always says backend_off; for a storage that is not local it said no_local_path.

Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
@ernolf ernolf self-assigned this Dec 2, 2026
@ernolf ernolf added enhancement New feature or request php Pull requests that update php code labels Dec 2, 2026
@ernolf
ernolf merged commit 2d3c94d into main Dec 2, 2026
53 checks passed
@github-actions
github-actions Bot deleted the ernolf/perf/offload-local-path branch December 2, 2026 22:47
@ernolf

ernolf commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

/backport to stable0.7

1 similar comment
@ernolf

ernolf commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

/backport to stable0.7

@ernolf

ernolf commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

/backport to stable0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request php Pull requests that update php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raw delivery copies a non-local file to a temp file with offload off

1 participant