8

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. Commented Nov 15, 2011 at 7:11

1 Answer 1

11
[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? Commented 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. Commented Nov 15, 2011 at 8:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.