{"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473717052", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473717052, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzcxNzA1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-17T21:32:24Z", "updated_at": "2019-03-17T21:33:16Z", "author_association": "OWNER", "body": "Since this feature is now controlled by a config setting, I'm inclined to make it also available via a URL parameter.\r\n\r\nIf you hit this URL:\r\n\r\n /fixtures/table.json?_hash=1\r\n\r\nWe can redirect to:\r\n\r\n /fixtures-c2342/table.json\r\n\r\nIn this way developers can opt-in to a hashed (and hence far-future cached) response on a per-query basis.\r\n\r\nThis option won't be available against mutable databases though, which are coming in #419 \r\n\r\nThis means that the `hash_urls:1` config basically has the effect of assuming `?_hash=1` on all URLs to mutable databases.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473715254", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473715254, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzcxNTI1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-17T21:11:37Z", "updated_at": "2019-03-17T21:11:37Z", "author_association": "OWNER", "body": "The code for this has got a bit tricky. I need to make a decision at some point as to if the current request is a hashed_url request (if it includes a DB hash in the URL which is the current correct hash). I then need to be able to use that fact to decide which default TTL value to apply when returning the response.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473714545", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473714545, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzcxNDU0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-17T21:03:08Z", "updated_at": "2019-03-17T21:04:17Z", "author_association": "OWNER", "body": "I'm going to introduce a new config setting: `default_cache_ttl_hashed` - and set the default value for `default_cache_ttl` to 10s (to protect against dog-piling).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473310026", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473310026, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzMxMDAyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T14:35:53Z", "updated_at": "2019-03-15T14:35:53Z", "author_association": "OWNER", "body": "See #418 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473160702", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473160702, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE2MDcwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T05:08:13Z", "updated_at": "2019-03-15T05:08:13Z", "author_association": "OWNER", "body": "This also needs extensive tests to ensure that with the option turned on all of the redirects behave as they should.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473159679", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473159679, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE1OTY3OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T05:01:27Z", "updated_at": "2019-03-15T05:01:27Z", "author_association": "OWNER", "body": "Also: if the option is False and the user visits a URL with a hash in it, should we redirect them?\r\n\r\nI'm inclined to say no: furthermore, I'd be OK continuing to serve a far-future cache header for that case.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473156513", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473156513, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE1NjUxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T04:40:29Z", "updated_at": "2019-03-15T04:40:29Z", "author_association": "OWNER", "body": "Still TODO: need to figure out what to do about cache TTL. Defaulting to 365 days no longer makes sense without the hash_urls setting.\r\n\r\nMaybe drop that setting default to 0?\r\n\r\nHere's the setting:\r\n\r\nhttps://github.com/simonw/datasette/blob/9743e1d91b5f0a2b3c1c0bd6ffce8739341f43c4/datasette/app.py#L84-L86\r\n\r\nAnd here's where it takes affect:\r\n\r\nhttps://github.com/simonw/datasette/blob/4462a5ab2817ac0d9ffe20dafbbf27c5c5b81466/datasette/views/base.py#L491-L501", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/416#issuecomment-473154643", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/416", "id": 473154643, "node_id": "MDEyOklzc3VlQ29tbWVudDQ3MzE1NDY0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-03-15T04:27:47Z", "updated_at": "2019-03-15T04:28:00Z", "author_association": "OWNER", "body": "Deployed a demo: https://datasette-optional-hash-demo.now.sh/\r\n\r\n datasette publish now \\\r\n ../demo-databses/russian-ads.db \\\r\n ../demo-databses/polar-bears.db \\\r\n --branch=optional-hash \\\r\n -n datasette-optional-hash \\\r\n --alias datasette-optional-hash-demo \\\r\n --install=datasette-cluster-map \\\r\n --install=datasette-json-html\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 421348146, "label": "URL hashing now optional: turn on with --config hash_urls:1 (#418)"}, "performed_via_github_app": null}