title: Using JavaScript Axios/Fetch. Can you disable browser cache?
body: <p>I am trying to query a quote API for a freeCodeCamp project I'm updating to React.js. I am now trying to use <code>Fetch</code> or <code>Axios</code> to query the API but it's caching the response in the browser. I know in <code>$ajax</code> there is a <code>{ cache: false }</code> that would force the browser to do a new request.</p>
  
  <p>Is there some way I will be able to do the same with <code>Fetch</code> or <code>Axios</code>?</p>
  
  <p>The <code>cache-control</code> setting seems to be already set to <code>max-age: 0</code> by <code>Axios</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/NqsNq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NqsNq.png" alt="enter image description here"></a></p>
  
  <p>This is my code I have that is querying the API.</p>
  
  <pre><code>generateQuote = () =&gt; {
    axios.get('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&amp;filter[posts_per_page]=1')
      .then(response =&gt; {
        const { title, content, link } = response.data[0];
        console.log(title, content, link)
        this.setState(() =&gt; ({ title, content, link }));
      })
      .catch(err =&gt; {
        console.log(`${err} whilst contacting the quote API.`)
      })
  </code></pre>
  
  <p>}</p>