· Naughties
· · 2006
· · · April
· · · · 15 (1 entry)

Rails Asset Naming · I said that I’d been ner­vous about one par­tic­u­lar Rails in­no­va­tion, rolling times­tamps in­to the URIs of stat­ic as­set­s, for ex­am­ple /im­ages/img23.jpg?20060412191322, be­cause it had the smell of level-mixing about it. So I talked to DHH about it, and he swore up and down that when the times­tamp (and hence the name) changes it’s be­cause this re­al­ly is a new thing (Re­source, in Web terms), not a changed ver­sion of the same thing. This leaves one ques­tion in my mind; does the sys­tem al­low for some­one to link to the ?20060412191322 ver­sion af­ter it’s been re­placed by one with a ?20070223101354 times­tam­p? Be­cause if the old one is au­tomag­i­cal­ly gone af­ter the new one ar­rives, I won­der if it re­al­ly is a new thing. The rea­son they do this is ob­vi­ous; they can set this kind of thing cacheable-forever at the HTTP lev­el and re­al­ly cut down, first on need­less traf­fic, but more im­por­tan­t, on user-perceived la­ten­cy. Which is a good thing.
author · Dad · software · colophon · rights
Random image, linked to its containing fragment

By .

I am an employee
of Amazon.com, but
the opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.