Skip to content

WebServer: improve speed of serving static files #92921

@AndreyDodonov-EH

Description

@AndreyDodonov-EH

Summary

In a webserver, in http_server_http1.c, in handle_http1_static_fs_resource:

STATIC_FS_RESPONSE_SIZE is calculated as a minimum amount of bytes needed for the header.
So buffer of the same size is then used to send file itself.
Currently it is 198 bytes, which results in a pretty slow file serving.

Describe the solution you'd like

Create a KConfig entry for that, e.g. CONFIG_HTTP_SERVER_STATIC_FS_RESPONSE_SIZE,
and, if its not equal to 0 (alternatively also if it is bigger than this calculated value), use it instead of STATIC_FS_RESPONSE_SIZE
Suggested fix:
#92971

Or we could rename STATIC_FS_RESPONSE_SIZE to STATIC_FS_RESPONSE_HEADER_SIZE, because that's what its, let it be calculated as it is now, and then use a separatre buffer of size CONFIG_HTTP_SERVER_STATIC_FS_RESPONSE_SIZE

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresarea: HTTPHTTP client/server support

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions