{"html_url": "https://github.com/simonw/datasette/pull/258#issuecomment-390577711", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/258", "id": 390577711, "node_id": "MDEyOklzc3VlQ29tbWVudDM5MDU3NzcxMQ==", "user": {"value": 247131, "label": "philroche"}, "created_at": "2018-05-21T07:38:15Z", "updated_at": "2018-05-21T07:38:15Z", "author_association": "NONE", "body": "Excellent, I was not aware of the auto redirect to the new hash. My bad\r\n\r\nThis solves my use case.\r\n\r\nI do agree that your suggested --no-url-hash approach is much neater. I will investigate ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 322741659, "label": "Add new metadata key persistent_urls which removes the hash from all database urls"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/258#issuecomment-389536870", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/258", "id": 389536870, "node_id": "MDEyOklzc3VlQ29tbWVudDM4OTUzNjg3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-16T14:22:31Z", "updated_at": "2018-05-16T14:22:31Z", "author_association": "OWNER", "body": "The principle benefit provided by the hash URLs is that Datasette can set a far-future cache expiry header on every response. This is particularly useful for JavaScript API work as it makes fantastic use of the browser's cache. It also means that if you are serving your API from behind a caching proxy like Cloudflare you get a fantastic cache hit rate.\r\n\r\nAn option to serve without persistent hashes would also need to turn off the cache headers.\r\n\r\nMaybe the option should support both? If you hit a page with the hash in the URL you still get the cache headers, but hits to the URL without the hash serve uncashed content directly.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 322741659, "label": "Add new metadata key persistent_urls which removes the hash from all database urls"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/258#issuecomment-389386142", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/258", "id": 389386142, "node_id": "MDEyOklzc3VlQ29tbWVudDM4OTM4NjE0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-16T03:51:13Z", "updated_at": "2018-05-16T03:51:13Z", "author_association": "OWNER", "body": "The URL does persist across deployments already, in that you can use the URL without the hash and it will redirect to the current location. Here's an example of that: https://san-francisco.datasettes.com/sf-trees/Street_Tree_List.json\r\n\r\nThis also works if you attempt to hit the incorrect hash, e.g. if you have deployed a new version of the database with an updated hash. The old hash will redirect, e.g. https://san-francisco.datasettes.com/sf-trees-c4b972c/Street_Tree_List.json\r\n\r\nIf you serve Datasette from a HTTP/2 proxy (I've been using Cloudflare for this) you won't even have to pay the cost of the redirect - Datasette sends a `Link: ; rel=preload` header with those redirects, which causes Cloudflare to push out the redirected source as part of that HTTP/2 request. You can fire up the Chrome DevTools to watch this happen.\r\n\r\nhttps://github.com/simonw/datasette/blob/2b79f2bdeb1efa86e0756e741292d625f91cb93d/datasette/views/base.py#L91\r\n\r\nAll of that said... I'm not at all opposed to this feature. For consistency with other Datasette options (e.g. `--cors`) I'd prefer to do this as an optional argument to the `datasette serve` command - something like this:\r\n\r\n datasette serve mydb.db --no-url-hash", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 322741659, "label": "Add new metadata key persistent_urls which removes the hash from all database urls"}, "performed_via_github_app": null}