6

According to the source, the JS and CSS files I'm loading are:

stub.js?v=e922af98260a
all.css?v=b7ced9688c61

Just wondering how those "v" parameters are generated. On my websites I generally just use an integer which I manually increment, so I'm curious if these are generated automatically somehow.

1
  • Don't know, but they're probably hashed for build updates. Nov 15, 2011 at 7:11

1 Answer 1

10
[balpha@localhost ~]$ curl -s http://meta.stackoverflow.com | grep stub.js
    <script type="text/javascript" src="/content/js/stub.js?v=e922af98260a"></script>
stub.js?v=e922af98260a
[balpha@localhost ~]$ curl -s http://meta.stackoverflow.com/content/js/stub.js | sha1sum
e922af98260a8e3c3e499cb81e5ebab95c9ac   -
[balpha@localhost ~]$ 

screenshot

2
  • Followup question - how do you insert the SHA1 prefix into (presumably) the ASP.NET MVC app?
    – Jon
    Nov 15, 2011 at 8:30
  • 1
    @Jon: The app has access to a local copy of the file (even if it's eventually served from the CDN), so it can just read the file once at startup, build the checksum, and then cache it.
    – balpha Staff
    Nov 15, 2011 at 8:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .