code: protected Long doResourceReplayCachedContent(
              IPortletWindow portletWindow,
              HttpServletRequest httpServletRequest,
              CacheState<CachedPortletResourceData<Long>, Long> cacheState,
              PortletResourceOutputHandler portletOutputHandler,
              long baseExecutionTime)
              throws IOException {
  
          enforceConfigPermission(httpServletRequest, portletWindow);
  
          logger.debug("Replaying cached content for resource request to {}", portletWindow);
  
          final long renderStartTime = System.nanoTime();
  
          final CachedPortletResourceData<Long> cachedPortletResourceData =
                  cacheState.getCachedPortletData();
          if (cachedPortletResourceData == null) {
              throw new PortletDispatchException(
                      "The portlet window '"
                              + portletWindow
                              + "' indicated via CacheControl#useCachedContent "
                              + "that the portal should render cached content, however there is no cached content to return. "
                              + "This is a portlet bug.",
                      portletWindow);
          }
  
          cachedPortletResourceData.replay(portletOutputHandler);
  
          final long executionTime = baseExecutionTime + (System.nanoTime() - renderStartTime);
  
          publishResourceEvent(portletWindow, httpServletRequest, executionTime, false, true);
  
          return executionTime;
      }
docs: Replay the cached content inside the {@link CachedPortletData} as the response to a
  doResource.