Just run updateCache one time if multiple requests come in while an update is already in progress...
771853
private void requestCacheUpdate() {
        log.debug("Cache update requested");
        if (updateRequested) {
            log.debug("Cache update, redundant request ignored.");
            return;
        }

        updateRequested = true;

        if (!updating) {
            updateCache();
        }
    }
1040926
def needs_update(self, cache_key):
    
    if not self.cacheable(cache_key):
      # An uncacheable CacheKey is always out of date.
      return True

    return self._read_sha(cache_key) != cache_key.hash
794683
protected void onlineCacheUpdate(CmsPublishedResource resource) {

        for (CachePair cachePair : m_caches) {
            try {
                cachePair.getOnlineCache().update(resource);
            } catch (Throwable e) {
                LOG.error(e.getLocalizedMessage());
            }
        }

    }
398921
private void updateStart(DownloadRequest request, long totalBytes) {
    /* if the request has failed before, donnot deliver callback */
    if (request.downloadState() == DownloadState.FAILURE) {
      updateState(request, DownloadState.RUNNING);
      return;
    }

    /* set the download state of this request as running */
    updateState(request, DownloadState.RUNNING);
    delivery.postStart(request, totalBytes);
  }
1075717
function (opts) {
        var target   = opts.target,
            priority = opts.priority,
            paused   = opts.paused

        var i, len
        var entry = {target: target, priority: priority, paused: paused}
        var added = false

        if (priority === 0) {
            this.updates0.push(entry)
        } else if (priority < 0) {
            for (i = 0, len = this.updatesNeg.length; i < len; i++) {
                if (priority < this.updatesNeg[i].priority) {
                    this.updatesNeg.splice(i, 0, entry)
                    added = true
                    break
                }
            }

            if (!added) {
                this.updatesNeg.push(entry)
            }
        } else /* priority > 0 */{
            for (i = 0, len = this.updatesPos.length; i < len; i++) {
                if (priority < this.updatesPos[i].priority) {
                    this.updatesPos.splice(i, 0, entry)
                    added = true
                    break
                }
            }

            if (!added) {
                this.updatesPos.push(entry)
            }
        }

        this.hashForUpdates[target.id] = entry
    }
560317
def process_response(self, request, response):
        """"""

        # never cache headers + ETag
        add_never_cache_headers(response)

        if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
            # We don't need to update the cache, just return.
            return response
        if request.method != 'GET':
            # This is a stronger requirement than above. It is needed
            # because of interactions between this middleware and the
            # HTTPMiddleware, which throws the body of a HEAD-request
            # away before this middleware gets a chance to cache it.
            return response
        if not response.status_code == 200:
            return response

        # use the precomputed cache_key
        if request._cache_middleware_key:
            cache_key = request._cache_middleware_key
        else:
            cache_key = learn_cache_key(request, response, self.cache_timeout, self.key_prefix)

        # include the orig_time information within the cache
        cache.set(cache_key, (time.time(), response), self.cache_timeout)
        return response
1258276
function onFetch(event) {
  // Make sure this is a request we should be handling in the first place.
  // If it's not, it's important to leave it alone and not call respondWith.
  let useCache = false;
  for (const prefix of CACHEABLE_URL_PREFIXES) {
    if (event.request.url.startsWith(prefix)) {
      useCache = true;
      break;
    }
  }

  // Now we need to check our resource lists.  The list of prefixes above won't
  // cover everything that was installed initially, and those things still need
  // to be read from cache.  So we check if this request URL matches one of
  // those lists.
  // The resource lists contain some relative URLs and some absolute URLs.  The
  // check here will only be able to match the absolute ones, but that's enough,
  // because the relative ones are covered by the loop above.
  if (!useCache) {
    if (CRITICAL_RESOURCES.includes(event.request.url) ||
        OPTIONAL_RESOURCES.includes(event.request.url)) {
      useCache = true;
    }
  }

  if (useCache) {
    event.respondWith(fetchCacheableResource(event.request));
  }
}
766123
def post_delete_update_cache(sender, instance, **kwargs):
    """"""
    name = sender.__name__
    if name in cached_model_names:
        from .tasks import update_cache_for_instance
        update_cache_for_instance(name, instance.pk, instance)
797854
def _refresh_synced(self):
        
        if self.path.startswith('http'):
            juicer.utils.Log.log_debug("%s is not synced" % self.path)
            self.is_synced = False
        else:
            juicer.utils.Log.log_debug("%s is synced" % self.path)
            self.is_synced = True
318722
def nocache(func):
    """"""

    def new_func(*args, **kwargs):
        """No cache Wrapper."""
        resp = make_response(func(*args, **kwargs))
        resp.cache_control.no_cache = True
        return resp

    return update_wrapper(new_func, func)
783866
def update(bulk = false)
      caught = catch(:halt)  do
        if self.new?
          save(bulk)
        else
          _run_update_callbacks do
            _run_save_callbacks do
              save_without_callbacks(bulk)
            end
          end
        end
      end
    end
857333
def update(cls, resource, new_name, algorithm, ssl_enable, ssl_disable):
        
        params = {}
        if new_name:
            params['name'] = new_name
        if algorithm:
            params['lb'] = {'algorithm': algorithm}
        if ssl_enable:
            params['ssl_enable'] = ssl_enable
        if ssl_disable:
            params['ssl_enable'] = False

        result = cls.call('hosting.rproxy.update', cls.usable_id(resource),
                          params)
        cls.echo('Updating your webaccelerator')
        cls.display_progress(result)
        cls.echo('The webaccelerator have been udated')
        return result
741120
def run_request(name='default', **kwargs):
    '''
    
    '''
    req = check_request()
    if name not in req:
        return {}
    n_req = req[name]
    if 'mods' not in n_req or 'kwargs' not in n_req:
        return {}
    req[name]['kwargs'].update(kwargs)
    if 'test' in n_req['kwargs']:
        n_req['kwargs'].pop('test')
    if req:
        ret = apply_(n_req['mods'], **n_req['kwargs'])
        try:
            os.remove(os.path.join(__opts__['cachedir'], 'req_state.p'))
        except (IOError, OSError):
            pass
        return ret
    return {}
134333
def on_put(self, req, resp, **kwargs):
        """"""
        validated = self.require_validated(req)
        return super().on_put(
            req, resp,
            handler=partial(self._update, validated=validated),
            **kwargs
        )
1357304
def process_response(self, request, response):
        """"""
        if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
            # We don't need to update the cache, just return.
            return response
        if request.method != 'GET':
            # This is a stronger requirement than above. It is needed
            # because of interactions between this middleware and the
            # HTTPMiddleware, which throws the body of a HEAD-request
            # away before this middleware gets a chance to cache it.
            return response
        if not response.status_code == 200:
            return response
        # Try to get the timeout from the "max-age" section of the "Cache-
        # Control" header before reverting to using the default cache_timeout
        # length.
        timeout = get_max_age(response)
        if timeout == None:
            timeout = self.cache_timeout
        elif timeout == 0:
            # max-age was set to 0, don't bother caching.
            return response
        patch_response_headers(response, timeout)
        if timeout:
            cache_key = learn_cache_key(request, response, timeout, self.key_prefix)
            cache.set(cache_key, response, timeout)
            logging.debug("UpdateCacheMiddleware: setting %s -> %s params are: %s" % (cache_key, request.path, get_cache_key_parameters(request)))
        return response
809295
function checkCache() {
// Check if new appcache is available, load it, and reload page.
//if (window.applicationCache) {
//  window.applicationCache.addEventListener('updateready', function(e) {
//    if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
//      window.applicationCache.swapCache();
//      if (confirm('A new version of this site is available. Load it?')) {
//        window.location.reload();
//      }
//    }
//  }, false);
//}

	if(cache) {

		cacheStatusValues[0] = 'uncached';
		cacheStatusValues[1] = 'idle';
		cacheStatusValues[2] = 'checking';
		cacheStatusValues[3] = 'downloading';
		cacheStatusValues[4] = 'updateready';
		cacheStatusValues[5] = 'obsolete';

		cache.addEventListener('cached', logEvent, false);
		cache.addEventListener('checking', logEvent, false);
		cache.addEventListener('downloading', logEvent, false);
		cache.addEventListener('error', logEvent, false);
		cache.addEventListener('noupdate', logEvent, false);
		cache.addEventListener('obsolete', logEvent, false);
		cache.addEventListener('progress', logEvent, false);
		cache.addEventListener('updateready', logEvent, false);
	}

}
1106122
function update (req, res, next) {
    for (var key in req.body) {
      req.body[key] = utils.toNative(req.body[key])
    }

    var id = utils.toNative(req.params.id)
    var chain = db.get(name)

    chain = req.method === 'PATCH'
      ? chain.updateById(id, req.body)
      : chain.replaceById(id, req.body)

    var resource = chain.value()

    if (resource) {
      res.locals.data = resource
    }

    next()
  }