{"html_url": "https://github.com/simonw/datasette/issues/1739#issuecomment-1117662420", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1739", "id": 1117662420, "node_id": "IC_kwDOBm6k_c5CnizU", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-04T18:21:18Z", "updated_at": "2022-05-04T18:21:18Z", "author_association": "OWNER", "body": "That prototype is now public: https://github.com/simonw/datasette-lite", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223699280, "label": ".db downloads should be served with an ETag"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1739#issuecomment-1116215371", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1739", "id": 1116215371, "node_id": "IC_kwDOBm6k_c5CiBhL", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-03T15:12:16Z", "updated_at": "2022-05-03T15:12:16Z", "author_association": "OWNER", "body": "That worked - both DBs are 304 for me now on a subsequent load of the page:\r\n\r\n\"CleanShot\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223699280, "label": ".db downloads should be served with an ETag"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1739#issuecomment-1116183369", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1739", "id": 1116183369, "node_id": "IC_kwDOBm6k_c5Ch5tJ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-03T14:43:14Z", "updated_at": "2022-05-03T14:43:14Z", "author_association": "OWNER", "body": "Relevant tests start here: https://github.com/simonw/datasette/blob/d60f163528f466b1127b2935c3b6869c34fd6545/tests/test_html.py#L395", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223699280, "label": ".db downloads should be served with an ETag"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1739#issuecomment-1116180599", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1739", "id": 1116180599, "node_id": "IC_kwDOBm6k_c5Ch5B3", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-03T14:40:32Z", "updated_at": "2022-05-03T14:40:32Z", "author_association": "OWNER", "body": "Database downloads are served here: https://github.com/simonw/datasette/blob/d60f163528f466b1127b2935c3b6869c34fd6545/datasette/views/database.py#L186-L192\r\n\r\nHere's `AsgiFileDownload`: https://github.com/simonw/datasette/blob/d60f163528f466b1127b2935c3b6869c34fd6545/datasette/utils/asgi.py#L410-L430\r\n\r\nI can add an `etag=` parameter to that and populate it with `db.hash`, if it is populated (which it always should be for immutable databases that can be downloaded).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223699280, "label": ".db downloads should be served with an ETag"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1739#issuecomment-1116178727", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1739", "id": 1116178727, "node_id": "IC_kwDOBm6k_c5Ch4kn", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-03T14:38:46Z", "updated_at": "2022-05-03T14:38:46Z", "author_association": "OWNER", "body": "Reminded myself how this works by reviewing `conditional-get`: https://github.com/simonw/conditional-get/blob/db6dfec0a296080aaf68fcd80e55fb3f0714e738/conditional_get/cli.py#L33-L52\r\n\r\nSimply add a `If-None-Match: last-known-etag` header to the request and check that the response is a status 304 with an empty body.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223699280, "label": ".db downloads should be served with an ETag"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1739#issuecomment-1115760104", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1739", "id": 1115760104, "node_id": "IC_kwDOBm6k_c5CgSXo", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-03T05:50:19Z", "updated_at": "2022-05-03T05:50:19Z", "author_association": "OWNER", "body": "Here's how Starlette does it: https://github.com/encode/starlette/blob/830f3486537916bae6b46948ff922adc14a22b7c/starlette/staticfiles.py#L213", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223699280, "label": ".db downloads should be served with an ETag"}, "performed_via_github_app": null}