Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

a better use for sha1 URLs

[Here's an old thought I never posted; dumping it here as I clean up my home directory. I never posted it before because I thought I ought to look at existing work in this space before I start feeling too creative -- this seems obvious enough to exist already. Whatever.]

If I use an image, I (in some circumstances, at least) want the display to break if the image changes. If I source an image off of someone else's site and use ("steal") it for my MySpace background, I'd rather see a broken image link than goatse when they notice where their bandwidth is going.

Images don't use the fragment part of their URLs. Let's say from now on I reference images with URLs containing like this:
<img src='http://example.com/foo.png#sha1=012312103120321'>
And then my browser could regard image data that don't have that SHA-1 as a broken image.

Additionally, my browser could implement a cross-site cache of image data. If there are two references to different URLs with the same SHA-1, it only needs to be loaded once. A browser with this functionality could even work with images like
<img src='#sha1=012312103120321'>
which means "pull from cache if you have it, otherwise I give up". In some sense, then, the fragment becomes the real identifier of the image, while the rest of the URL is a hint as to one source to get the image data from.
Subscribe

  • blog moved

    As described elsewhere, I've quit LiveJournal. If you're interested in my continuing posts, you should look at one of these (each contains feed…

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • treemaps

    I finally wrote up my recent adventures in treemapping, complete with nifty clickable visualizations.

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 8 comments