title: Django - Implement and test cache busting
body: <p>It looks like I'm facing cache issues with my application so I would like to implement this cache busting feature as it was recommended to me.<br />
  The context: my application is already in a production server (alpha version) and as this is an evolution of the ground settings, I would like to take this opportunity to train myself to prepare, test and deliver such technical updates. I'll take the opportunity to better understand static files management. Currently, the js and css files are not properly propagated and my production app still uses older versions, so I need to enforce a server cache refresh.</p>
  <p>As I'm not comfortable at all with all of this stuff and static files management, I would like to double check the process and understand how I could test it before pushing to production.</p>
  <p><strong>How to proceed</strong><br />
  As far as I understand, what I have to do is to change my settings file and add the following line:</p>
  <pre class="lang-py prettyprint-override"><code>STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
  </code></pre>
  <p>I'm wondering if I need to change anything else. Here are my current settings about static files management:</p>
  <pre class="lang-py prettyprint-override"><code>STATIC_URL = &quot;/static/&quot;
  STATIC_ROOT = os.path.join(BASE_DIR, &quot;static/&quot;)
  STATICFILES_DIRS = []
  </code></pre>
  <p>I've mainly seen several approaches for <code>STATICFILES_DIRS</code> (either <code>[]</code> or <code>./myapp/static</code> or <code>(os.path.join(BASE_DIR, &quot;my_project&quot;, &quot;static&quot;), )</code>) but I do not know the differences, and what is the better setting</p>
  <p>I've read some use cases where it was recommended to 'reinit' the settings: delete the static directory and rebuild everything (migrations, collect static), and I wonder if it's necessary? Shall I run <code>python manage.py collectstatic</code>? Anything else?</p>
  <p>Btw I'm currently using Django 2.2 and I will upgrade to Django 4.x as far as possible in a near future.</p>
  <p><strong>How to test</strong><br />
  The key parameter to activate this feature is to set <code>DEBUG = False</code>
  Can I test this modification directly in my local development environment? To check if it works, is it enough to make small changes within js / css and ensure these changes are applied?</p>
  <p><strong>How to deploy</strong><br />
  Are there any dedicated manipulations to perform?
  I mean, I will pull the committed changes and reload gunicorn service as usual), am I supposed to do anything else?</p>
  <p>Many thanks for your advises, again I'm not comfortable with such subject and I hope it will help other newbies like I am ^^</p>