title: django static files versioning
body: <p>I'm working on some universal solution for problem with static files and updates in it.</p>
  
  <p>Example: let's say there was site with <code>/static/styles.css</code> file - and site was used for a long time - so a lot of visitors cached this file in browser</p>
  
  <p>Now we doing changes in this css file, and update on server, but some users still have old version (despite modification date returned by server)</p>
  
  <p>The obvious solution is to add some version to file <code>/static/styles.css?v=1.1</code> but in this case developer must track changes in this file and manually increase version</p>
  
  <p>A second solution is to count the md5 hash of the file and add it to the url <code>/static/styels.css/?v={mdp5hashvalue}</code> which looks much better, but md5 should be calculated automatically somehow.</p>
  
  <p>they possible way I see it - create some template tag like this</p>
  
  <pre><code>{% static_file  "style.css" %}
  </code></pre>
  
  <p>which will render </p>
  
  <pre><code>&lt;link src="/static/style.css?v=md5hash"&gt;
  </code></pre>
  
  <p>BUT, I do not want this tag to calculate md5 on every page load, and I do not want to store hash in django-cache, because then we will have to clear after updating file...</p>
  
  <p>any thoughts ?</p>