-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
Add ETag header for static responses #2306
Conversation
I've branched from latest main, but black found files to be reformatted.
EDIT: found out it was my |
2fba5f9
to
89b5574
Compare
89b5574
to
2694d8b
Compare
2694d8b
to
9d7152d
Compare
Done, and tests passes. However, there's still a weird runtime error. Checking now.
|
Might be related to how I'm forwarding headers. |
0fd5f16
to
eacf20c
Compare
Done! fixed. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2306 +/- ##
=======================================
Coverage 92.44% 92.45%
=======================================
Files 42 42
Lines 6420 6441 +21
=======================================
+ Hits 5935 5955 +20
- Misses 485 486 +1 ☔ View full report in Codecov by Sentry. |
This is clearly a good idea. Adding it directly to datasette/datasette/views/database.py Lines 327 to 340 in 261fc8d
|
Yes. I tried adding it inside |
Related to #1645
This PR adds ETag headers for static responses. Adding cache-control headers was previously discussed but nothing done yet, so I've thought adding ETag headers would drastically reduce bandwidth meanwhile. Specially, when quickly deploying to Vercel or Fly, and you don't own a domain, required to add a CDN on front.
📚 Documentation preview 📚: https://datasette--2306.org.readthedocs.build/en/2306/