title: Does koa serve canceled requests?
body: <p>I have a endpoint in koa, that loads much data from the database and then calculates some results based on it. This can take some seconds.</p>
  
  <p>What happens to a request, if the browser cancels it? Like the browser tab gets closed etc.</p>
  
  <p>For example, would <code>cache.c</code> be filled even if the browser canceled or is koa smart enough to simply stop any actions it started for this request?</p>
  
  <pre><code>const cache = {}
  router.get('/data', function *(next) {
  
    if (cache.c) return this.body = cache.c
  
    // somewhere here the browser cancels the request
    //---
    const a = yield db.getA()
    const b = yield db.getB()
    cache.c = yield calculateC(a,b)
    //---
  
    this.body = cache.c
  
  })
  </code></pre>