Prevents client cache.
Note that "pragma: no-cache" is linked to requests, not responses:
http://palizine.plynt.com/issues/2008Jul/cache-control-attributes/
348152
public static void setNoClientCache(HttpHeaders headers) {
        // http://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.3.html#section-11
        headers.remove(EXPIRES);
        headers.remove(LAST_MODIFIED);
        headers.set(CACHE_CONTROL, "no-store, no-cache, must-revalidate, max-age=0");
    }
1018017
public static void setNoCache(HttpServletRequest request,
								  HttpServletResponse response)
	{
		//get rid of unwanted whitespace
		String protocol = request.getProtocol().trim();

//		if ("HTTP/1.0".equals(protocol))
		{
			response.setHeader("Pragma", "no-cache");
		}
//		else if ("HTTP/1.1".equals(protocol))
		{
			response.setHeader("Cache-Control", "no-cache, max-age=0, revalidate");//no-store only disables archiving
		}

		//get browser type
//		String userAgent = request.getHeader("User-Agent");

//		if ((userAgent != null) && (userAgent.indexOf("MSIE") != -1))
		{
			//Internet Explorer:
			//date and timestamp will be set to jan 1st 1970, so no caching is performed.
//			response.setDateHeader("Expires", 0);
		}
		long now = System.currentTimeMillis();
		response.setDateHeader("Date", now);
		response.setDateHeader("Expires", now);
		response.setDateHeader("Last-Modified", now);


	}
1350917
def delete_client(client_id, preserve_cache):
    
    if client_id in drivers:
        drivers.pop(client_id).quit()
        try:
            timers[client_id].stop()
            timers[client_id] = None
            release_semaphore(client_id)
            semaphores[client_id] = None
        except:
            pass

    if not preserve_cache:
        pth = CHROME_CACHE_PATH + g.client_id
        shutil.rmtree(pth)
700011
boolean isKeepaliveAllowed(long connectionStartTime)
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    else if (connectionStartTime + _keepaliveTimeMax < CurrentTime.currentTime()) {
      return false;
    }
    else if (_keepaliveMax <= _keepaliveAllocateCount.get()) {
      return false;
    }
    /*
    else if (_connThreadPool.isThreadMax()
             && _connThreadPool.isIdleLow()
             && ! isKeepaliveAsyncEnabled()) {
      return false;
    }
    */
    else {
      return true;
    }
  }
805343
def request(self, _cache_key, _cache_ignore, _cache_timeout, **kwargs):
        
        if _cache_key:
            # Pop the request's session cookies from the cache key.
            # These appear to be unreliable and change with every
            # request. Also, with the introduction of OAuth I don't think
            # that cookies are being used to store anything that
            # differentiates API requests anyways
            url, items = _cache_key
            _cache_key = (url, (items[0], items[1], items[3], items[4]))

        if kwargs['request'].method != 'GET':
            # I added this check for RTV, I have no idea why PRAW would ever
            # want to cache POST/PUT/DELETE requests
            _cache_ignore = True

        if _cache_ignore:
            return self._request(**kwargs)

        self._clear_timeouts(_cache_timeout)
        if _cache_key in self.cache:
            return self.cache[_cache_key]

        result = self._request(**kwargs)

        # The handlers don't call `raise_for_status` so we need to ignore
        # status codes that will result in an exception that should not be
        # cached.
        if result.status_code not in (200, 302):
            return result

        self.timeouts[_cache_key] = timer()
        self.cache[_cache_key] = result
        return result
70479
def no_cache(asset_url):
    
    pos = asset_url.rfind('?')
    if pos > 0:
        asset_url = asset_url[:pos]
    return asset_url
1173806
@Nonnull
  public EChange clearCache ()
  {
    return m_aRWLock.writeLocked ( () -> {
      EChange ret = m_aList.removeAll ();
      if (!m_aMapExt.isEmpty ())
      {
        m_aMapExt.clear ();
        ret = EChange.CHANGED;
      }
      if (!m_aMapMimeType.isEmpty ())
      {
        m_aMapMimeType.clear ();
        ret = EChange.CHANGED;
      }
      return ret;
    });
  }
404942
@Nonnull
  public final UnifiedResponse disableCaching ()
  {
    // Remove any eventually set headers
    removeCaching ();

    if (m_eHttpVersion.is10 ())
    {
      // Set to expire far in the past for HTTP/1.0.
      m_aResponseHeaderMap.setHeader (CHttpHeader.EXPIRES, ResponseHelperSettings.EXPIRES_NEVER_STRING);

      // Set standard HTTP/1.0 no-cache header.
      m_aResponseHeaderMap.setHeader (CHttpHeader.PRAGMA, "no-cache");
    }
    else
    {
      final CacheControlBuilder aCacheControlBuilder = new CacheControlBuilder ().setNoStore (true)
                                                                                 .setNoCache (true)
                                                                                 .setMustRevalidate (true)
                                                                                 .setProxyRevalidate (true);

      // Set IE extended HTTP/1.1 no-cache headers.
      // http://aspnetresources.com/blog/cache_control_extensions
      // Disabled because:
      // http://blogs.msdn.com/b/ieinternals/archive/2009/07/20/using-post_2d00_check-and-pre_2d00_check-cache-directives.aspx
      if (false)
        aCacheControlBuilder.addExtension ("post-check=0").addExtension ("pre-check=0");

      setCacheControl (aCacheControlBuilder);
    }
    return this;
  }
228862
function _use_zcache_p(yes_no){
	if( yes_no == true ){
	    use_zcache_p = true;
	}else if( yes_no == false ){
	    use_zcache_p = false;
	}
	return use_zcache_p;
    }
1029979
def should_cache(self, request, response):
        

        if not getattr(request, '_cache_update_cache', False):
            return False
        if not response.status_code in getattr(settings, 'BETTERCACHE_CACHEABLE_STATUS', CACHEABLE_STATUS):
            return False
        if getattr(settings, 'BETTERCACHE_ANONYMOUS_ONLY', False) and self.session_accessed and request.user.is_authenticated:
            return False
        if self.has_uncacheable_headers(response):
            return False
        return True
242710
@Override
    public void clearCache(String cacheInstance) throws javax.management.AttributeNotFoundException {

        //Get the cache for this cacheInstance
        DCache cache1 = getCache(cacheInstance);
        cache1.clear();
        if (tc.isDebugEnabled())
            Tr.debug(tc, "clearCache: Exiting. Cleared memory and disk cache for cacheInstance = " + cacheInstance);

        return;
    }
1119215
public function nocacheing_headers()
    {
        if (headers_sent()) {
            return;
        }

        header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
        header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

        // We need to set the following headers to make downloads work using IE in HTTPS mode.
        if ($this->browser->ie && rcube_utils::https_check()) {
            header('Pragma: private');
            header("Cache-Control: private, must-revalidate");
        }
        else {
            header("Cache-Control: private, no-cache, no-store, must-revalidate, post-check=0, pre-check=0");
            header("Pragma: no-cache");
        }
    }
572016
public static void disableURLCaches() {
        BeanDesc bd = BeanDescFactory.getBeanDesc(URLConnection.class);
        LdiFieldUtil.set(bd.getField("defaultUseCaches"), null, Boolean.FALSE);
    }
78265
@Override
	public void clearCache(CPInstance cpInstance) {
		entityCache.removeResult(CPInstanceModelImpl.ENTITY_CACHE_ENABLED,
			CPInstanceImpl.class, cpInstance.getPrimaryKey());

		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

		clearUniqueFindersCache((CPInstanceModelImpl)cpInstance, true);
	}
357628
protected void processNoCache( HttpServletRequest request, HttpServletResponse response )
    {
        //
        // Set the no-cache headers if:
        //    1) the module is configured for it, or
        //    2) netui-config.xml has an "always" value for <pageflow-config><prevent-cache>, or
        //    3) netui-config.xml has an "inDevMode" value for <pageflow-config><prevent-cache>, and we're not in
        //       production mode.
        //
        boolean noCache = moduleConfig.getControllerConfig().getNocache();

        if ( ! noCache )
        {
            PageFlowConfig pfConfig = ConfigUtil.getConfig().getPageFlowConfig();
            
            if ( pfConfig != null )
            {
                PreventCache preventCache = pfConfig.getPreventCache();
                
                if ( preventCache != null )
                {
                    switch ( preventCache.getValue() )
                    {
                        case PreventCache.INT_ALWAYS:
                            noCache = true;
                            break;
                        case PreventCache.INT_IN_DEV_MODE:
                            noCache = ! _servletContainerAdapter.isInProductionMode();
                            break;
                    }
                }
            }
        }
        
        if ( noCache )
        {
            //
            // The call to PageFlowPageFilter.preventCache() will cause caching to be prevented
            // even when we end up forwarding to a page.  Normally, no-cache headers are lost
            // when a server forward occurs.
            //
            ServletUtils.preventCache( response );
            PageFlowUtils.setPreventCache( request );
        }
    }
1057326
def no_cache_dir_callback(option, opt, value, parser):
    
    # The value argument will be None if --no-cache-dir is passed via the
    # command-line, since the option doesn't accept arguments.  However,
    # the value can be non-None if the option is triggered e.g. by an
    # environment variable, like PIP_NO_CACHE_DIR=true.
    if value is not None:
        # Then parse the string value to get argument error-checking.
        try:
            strtobool(value)
        except ValueError as exc:
            raise_option_error(parser, option=option, msg=str(exc))

    # Originally, setting PIP_NO_CACHE_DIR to a value that strtobool()
    # converted to 0 (like "false" or "no") caused cache_dir to be disabled
    # rather than enabled (logic would say the latter).  Thus, we disable
    # the cache directory not just on values that parse to True, but (for
    # backwards compatibility reasons) also on values that parse to False.
    # In other words, always set it to False if the option is provided in
    # some (valid) form.
    parser.values.cache_dir = False
331710
public boolean syncApplications(NewRelicCache cache)
    {
        boolean ret = true;

        if(apiClient == null)
            throw new IllegalArgumentException("null API client");

        // Get the application configuration using the REST API
        if(cache.isApmEnabled() || cache.isBrowserEnabled() || cache.isMobileEnabled())
        {
            ret = false;

            if(cache.isApmEnabled())
            {
                logger.info("Getting the applications");
                Collection<Application> applications = apiClient.applications().list();
                for(Application application : applications)
                {
                    cache.applications().add(application);

                    logger.fine("Getting the hosts for application: "+application.getId());
                    cache.applications().applicationHosts(application.getId()).add(apiClient.applicationHosts().list(application.getId()));

                    logger.fine("Getting the instances for application: "+application.getId());
                    cache.applications().applicationHosts(application.getId()).addApplicationInstances(apiClient.applicationInstances().list(application.getId()));

                    logger.fine("Getting the deployments for application: "+application.getId());
                    cache.applications().deployments(application.getId()).add(apiClient.deployments().list(application.getId()));
                }

                // Get the key transaction configuration using the REST API
                try
                {
                    logger.info("Getting the key transactions");
                    cache.applications().addKeyTransactions(apiClient.keyTransactions().list());
                }
                catch(ErrorResponseException e)
                {
                    if(e.getStatus() == 403) // throws 403 if not allowed by subscription
                        logger.warning("Error in get key transactions: "+e.getMessage());
                    else
                        throw e;
                }
            }

            if(cache.isBrowserEnabled())
            {
                logger.info("Getting the browser applications");
                cache.browserApplications().add(apiClient.browserApplications().list());
            }

            if(cache.isBrowserEnabled())
            {
                logger.info("Getting the mobile applications");
                cache.mobileApplications().add(apiClient.mobileApplications().list());
            }

            cache.setUpdatedAt();

            ret = true;
        }

        return ret;
    }