dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.58k stars 25.29k forks source link

Explain direct file transmissions #31126

Open mtomberger opened 10 months ago

mtomberger commented 10 months ago

Description

The documentation in /fundamentals/servers/index.md states that HTTP.sys supports "direct file transmission" while Kestrel does not. It is not explained nor linked what "direct file transmissions" are within this context. I tried to find resources about this feature in the HTTP.sys documentation but it seams that it is not mentioned anywhere.

What are "direct file transmissions" and how does HTTP.sys support them?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/?view=aspnetcore-8.0&tabs=windows

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/servers/index.md

Document ID

32a343a1-ba87-7274-e861-2ac194d5aa3d

Article author

tdykstra

Rick-Anderson commented 10 months ago

@StephenCleary can you explain direct file transmissions

StephenCleary commented 10 months ago

Did you mean to tag someone else?

What I believe it's referring to is that http.sys has special ways to tell the kernel to read a file from disk and send it over the socket as the response. This can be very efficient since the entire file is transferred in kernel mode, avoiding copying the file into user space memory. See HTTP_DATA_CHUNK.