title: How to disable caching for i18next translation.json files?
body: <p>I'm running a single page app on IIS and using i18next library for translations in my app. The problem is that sometimes when I add new keywords to my translation.json file and hit refresh, the browser still uses the old cached translation file and this results in user seeing the added keywords but not translations. E.g. if I add a keyword <code>"somekey": "Some text here..."</code> then <code>somekey</code> would be displayed instead of the specified text.</p>
  
  <p>As my translation.json file is located in a folder called <code>locales</code> like this:</p>
  
  <pre><code>locales
      en
        translation.json
  </code></pre>
  
  <p>I tried adding following setting to web.config:</p>
  
  <pre><code>&lt;location path="locales"&gt;
    &lt;system.webServer&gt;
      &lt;staticContent&gt;
        &lt;clientCache cacheControlMode="DisableCache" /&gt;
      &lt;/staticContent&gt;
    &lt;/system.webServer&gt;
  &lt;/location&gt;
  </code></pre>
  
  <p>However, when I looked at the network traffic with Chrome developer tools, I noticed that translation.json file is still coming from cache and <code>Cache-Control: no-cache</code> header is missing. Why this does not work? What is right way to disable the caching of the file?</p>
  
  <p><strong>EDIT</strong>: Just checked the site again and it seems that translation.json file now has the <code>Cache-Control: no-cache</code> header and it is actually being retrieved from server every time I refresh the page. At this point I'm thinking that the issue might have had something to do with our release process and config changes not being applied. Not sure though.</p>