<editor-fold defaultstate="collapsed" desc="Content cache">
182088
public CharBuffer getCachedContent(JavaFileObject file) {
        ContentCacheEntry e = contentCache.get(file);
        if (e == null)
            return null;

        if (!e.isValid(file)) {
            contentCache.remove(file);
            return null;
        }

        return e.getValue();
    }
660333
@Override
    public ImmutableMap<String, JSONObject> pointInTimeCache() {
        if (m_shutdown.get()) {
            throw new RuntimeException("Requested cache from shutdown MapCache.");
        }
        return m_publicCache.get();
    }
670279
private void put(CmsFlexCacheKey key, CmsFlexCacheEntry theCacheEntry) {

        CmsFlexCacheVariation o = m_keyCache.get(key.getResource());
        if (key.getTimeout() > 0) {
            theCacheEntry.setDateExpiresToNextTimeout(key.getTimeout());
        }
        if (o != null) {
            // We already have a variation map for this resource
            Map<String, I_CmsLruCacheObject> m = o.m_map;
            boolean wasAdded = true;
            if (!m.containsKey(key.getVariation())) {
                wasAdded = m_variationCache.add(theCacheEntry);
            } else {
                wasAdded = m_variationCache.touch(theCacheEntry);
            }

            if (wasAdded) {
                theCacheEntry.setVariationData(key.getVariation(), m);
                m.put(key.getVariation(), theCacheEntry);
            }
        } else {
            // No variation map for this resource yet, so create one
            CmsFlexCacheVariation list = new CmsFlexCacheVariation(key);

            boolean wasAdded = m_variationCache.add(theCacheEntry);

            if (wasAdded) {
                theCacheEntry.setVariationData(key.getVariation(), list.m_map);
                list.m_map.put(key.getVariation(), theCacheEntry);
                m_keyCache.put(key.getResource(), list);
            }
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(
                    Messages.LOG_FLEXCACHE_ADDED_ENTRY_FOR_RESOURCE_WITH_VARIATION_3,
                    new Integer(m_size),
                    key.getResource(),
                    key.getVariation()));
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_ADDED_ENTRY_1, theCacheEntry.toString()));
        }
    }
717517
public void cacheCleared(DCache cache) {
        final String methodName = "cacheCleared()";
        ExpirationMetaData expirationMetaData = (ExpirationMetaData)cacheInstancesTable.get(cache);
        if (expirationMetaData == null) {
            return;
        }
        synchronized (expirationMetaData) {
            if (!expirationMetaData.expirationTable.isEmpty()) {
                Enumeration e = expirationMetaData.expirationTable.elements();
                while (e.hasMoreElements()) {
                    InvalidationTask it = (InvalidationTask)e.nextElement();
                    it.reset();
                    taskPool.add(it);
                }
                expirationMetaData.expirationTable.clear();
                expirationMetaData.timeLimitHeap.clear();
                if (tc.isDebugEnabled()){
                	Tr.debug(tc, methodName + cache.getCacheName() + " expirationTable=" + expirationMetaData.expirationTable.size());
                }
            }
        }
    }
91615
def can_use_cached_output(self, contentitem):
        
        plugin = contentitem.plugin
        return appsettings.FLUENT_CONTENTS_CACHE_OUTPUT and plugin.cache_output and contentitem.pk
1141811
def can_use_cached_output(self, contentitem):
        
        return contentitem.plugin.search_output and not contentitem.plugin.search_fields \
           and super(SearchRenderingPipe, self).can_use_cached_output(contentitem)
657214
private void reload() {

        CmsManyToOneMap<String, CmsUUID> newMap = new CmsManyToOneMap<String, CmsUUID>();
        try {
            List<CmsUrlNameMappingEntry> mappings = m_cms.readUrlNameMappings(CmsUrlNameMappingFilter.ALL);
            LOG.info("Initializing detail name cache with " + mappings.size() + " entries");
            for (CmsUrlNameMappingEntry entry : mappings) {
                newMap.put(entry.getName(), entry.getStructureId());
            }
            m_detailIdCache = newMap;
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
1363183
@Override
    protected void initContent() {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
        // get the default encoding
        String content = getParamContent();
        if (CmsStringUtil.isNotEmpty(content)) {
            // content already read, must be decoded
            setParamContent(decodeContent(content));
            return;
        } else {
            content = "";
        }

        try {
            // lock resource if autolock is enabled
            checkLock(getParamResource());
            CmsFile editFile = getCms().readFile(getParamResource(), CmsResourceFilter.ALL);
            content = CmsEncoder.createString(editFile.getContents(), getFileEncoding());
        } catch (CmsException e) {
            // reading of file contents failed, show error dialog
            try {
                showErrorPage(this, e);
            } catch (JspException exc) {
                // should usually never happen
                if (LOG.isInfoEnabled()) {
                    LOG.info(exc);
                }
            }
        }
        setParamContent(content);
    }
522480
public void cache() {
        if (!isCached.getAndSet(true)) {
            this.cache = node.isCache();
            this.cacheHint = node.getCacheHint();
            node.setCache(true);
            node.setCacheHint(CacheHint.SPEED);
            if (node instanceof Region) {
                this.cacheShape = ((Region) node).isCacheShape();
                this.snapToPixel = ((Region) node).isSnapToPixel();
                ((Region) node).setCacheShape(true);
                ((Region) node).setSnapToPixel(true);
            }
        }
    }
311253
private void applyCacheHeaders(final Properties cacheProperties, final httpClientInteraction method) {
        if (isCachedContentPresent() && null != contentType) {
            if (cacheProperties.containsKey(E_TAG)) {
                method.setRequestHeader(IF_NONE_MATCH, cacheProperties.getProperty(E_TAG));
            }
            if (cacheProperties.containsKey(LAST_MODIFIED)) {
                method.setRequestHeader(IF_MODIFIED_SINCE, cacheProperties.getProperty(LAST_MODIFIED));
            }
        }
    }
995874
public void cache(Map<String, Object> resources) {
		verifyState();

		if (!cacheLocked.get()) {
			resourceCache.get().putAll(resources);
		}
	}
600442
public void setContentCentered(boolean contentCentered) {
        boolean oldVal = this.contentCentered;
        this.contentCentered = contentCentered;
        if (oldVal != this.contentCentered && content != null && content.isAttached()) {
            if (this.contentCentered) {
                centerContent();
                initWindowResize();
            } else {
                clearCenterContent();
            }
        }
    }
428989
@Override
    protected void initContent() {

        if (CmsStringUtil.isNotEmpty(getParamContent())) {
            if (CmsStringUtil.isNotEmpty(getParamElementname())
                && getParamElementname().equals(getParamOldelementname())) {
                if (CmsStringUtil.isNotEmpty(getParamElementlanguage())
                    && getParamElementlanguage().equals(getParamOldelementlanguage())) {
                    return;
                }
            }
        }
        getCms().getRequestContext().setAttribute(CmsRequestContext.ATTRIBUTE_EDITOR, Boolean.TRUE);

        String elementData;
        if (m_page.hasValue(getParamElementname(), getElementLocale())) {
            // element value is available in the page
            elementData = m_page.getStringValue(getCms(), getParamElementname(), getElementLocale());
        } else {
            // value is not available in the page
            if (Boolean.valueOf(getParamDirectedit()).booleanValue()) {
                // direct edit on a non-existing element: create new element with this name
                m_page.addValue(getParamElementname(), getElementLocale());
            }
            elementData = "";
        }
        setParamContent(elementData);
    }
516487
private void clearCachedEncodings() {

        cachedEncodedString = null;
        cachedPartialEncodedString = null;

        for (int i = 0; i < cachedEncoding.length; i++)
            cachedEncoding[i] = null;
    }
93661
private void cacheView(View view) {

        if (!m_refreshing && (view instanceof I_CmsAppView) && ((I_CmsAppView)view).isCachable()) {
            m_cachedViews.put(((I_CmsAppView)view).getName(), (I_CmsAppView)view);
        }
    }
887813
private static CmsXmlContainerPage getCache(CmsObject cms, CmsResource resource, boolean keepEncoding) {

        if (resource instanceof I_CmsHistoryResource) {
            return null;
        }
        return getCache().getCacheContainerPage(
            getCache().getCacheKey(resource.getStructureId(), keepEncoding),
            cms.getRequestContext().getCurrentProject().isOnlineProject());
    }
172867
private CmsXmlContent getContentDocument(CmsFile file, boolean fromCache) throws CmsXmlException {

        CmsXmlContent content = null;
        if (fromCache) {
            content = getSessionCache().getCacheXmlContent(file.getStructureId());
        }
        if (content == null) {
            content = CmsXmlContentFactory.unmarshal(getCmsObject(), file);
            getSessionCache().setCacheXmlContent(file.getStructureId(), content);
        }
        return content;
    }