5 ms·
> since the URL to each database incorporates a sha256 hash of the database contents Small nitpick: It incorporates a SHA-256 prefix, i.e. a greatly reduced SH
by vog 9y ago
> since the URL to each database incorporates a sha256 hash of the database contents
Small nitpick: It incorporates a SHA-256 prefix, i.e. a greatly reduced SHA-256 hash, so the cryptographic integrity guarantees no longer hold.
> send a far-future cache expiry header on everything
If you really want to do that, you should include the full SHA-256 hash in the URL. If you want to shorten the URL, use a more compact encoding (e.g. Base64 or Ascii85, hex).
Alternatively, make it optional (but I admit this probably defeats the purpose): Short URLs without hash and short expiration, long URLs with hash and eternal expiration.
- simonw 9y agoI don’t need cryptographic guarantees because I’m not dealing with untrusted data: if you want to screw up Datasette’s caching model by deliberately creating two different databases with the same sha256 prefix then go ahead - you’ll only be hurting your own deployment. As such I figured that if a SHA prefix is good enough for common usage of git, it’s good enough for me.