Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ETag for static files #2243

Open
vytas7 opened this issue Jul 13, 2024 · 2 comments
Open

Support ETag for static files #2243

vytas7 opened this issue Jul 13, 2024 · 2 comments
Labels
enhancement good first issue Comment on this issue if you'd like to volunteer to work on this. Thanks! needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks!

Comments

@vytas7
Copy link
Member

vytas7 commented Jul 13, 2024

Render the ETag header when serving static files. We are already performing .stat() on the open file handle, so we should have the required data in order to build an ETag. We could use the same algorithm as the popular Nginx web server.

When serving, also check the If-None-Match header, and render HTTP 304 Not Modified if appropriate.

@vytas7 vytas7 added good first issue Comment on this issue if you'd like to volunteer to work on this. Thanks! enhancement needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks! europython2024 labels Jul 13, 2024
@vytas7 vytas7 added this to the Triaged (Non-Breaking Changes) milestone Aug 10, 2024
@dominik-air
Copy link

Hi! I'd be interested in helping with this enhancement. Any tips on where I should look in the project? I did some basic searching yesterday, but wasn't able to find a file/module this feature could be integrated into.

@vytas7
Copy link
Member Author

vytas7 commented Sep 16, 2024

Hi @dominik-air!
And thanks for your interest in contributing to the project!

Serving static files is implemented in falcon/routing/static.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Comment on this issue if you'd like to volunteer to work on this. Thanks! needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks!
Projects
None yet
Development

No branches or pull requests

2 participants