Use this API to add cacheforwardproxy.
347698
public static base_response add(nitro_service client, cacheforwardproxy resource) throws Exception {
		cacheforwardproxy addresource = new cacheforwardproxy();
		addresource.ipaddress = resource.ipaddress;
		addresource.port = resource.port;
		return addresource.add_resource(client);
	}
548049
@Override
	public <T> T forwardTo(final Class<T> type) {
		return proxifier.proxify(type, new MethodInvocation<T>() {

			@Override
			public Object intercept(T proxy, Method method, Object[] args, SuperMethod superMethod) {
				try {
					logger.debug("Executing {}", method);
					ControllerMethod old = methodInfo.getControllerMethod();
					methodInfo.setControllerMethod(DefaultControllerMethod.instanceFor(type, method));
					Object methodResult = method.invoke(container.instanceFor(type), args);
					methodInfo.setControllerMethod(old);

					Type returnType = method.getGenericReturnType();
					if (!(returnType == void.class)) {
						request.setAttribute(extractor.nameFor(returnType), methodResult);
					}
					
					if (response.isCommitted()) {
						logger.debug("Response already commited, not forwarding.");
						return null;
					}
					String path = resolver.pathFor(DefaultControllerMethod.instanceFor(type, method));
					logger.debug("Forwarding to {}", path);
					request.getRequestDispatcher(path).forward(request, response);
					return null;
				} catch (InvocationTargetException e) {
					propagateIfPossible(e.getCause());
					throw new ProxyInvocationException(e);
				} catch (Exception e) {
					throw new ProxyInvocationException(e);
				}
			}
		});
	}
474768
private <T, V> boolean addToMap(Map<Class<?>, Map<T, V>> proxyMap,
                                    T f,
                                    V proxy) {
        Map<T, V> proxies = proxyMap.get(serviceClass);
        if (proxies == null) {
            proxies = new HashMap<T, V>();
            proxyMap.put(serviceClass, proxies);
        }
        if (!proxies.containsKey(f)) {
            proxies.put(f, proxy);
            return true;
        }
        return false;
    }
1219187
private <T> T loadDataFromCache(final Class<T> clazz, final Object cacheKey, final long maxTimeInCacheBeforeExpiry) throws CacheLoadingException, CacheCreationException {
        return cacheManager.loadDataFromCache(clazz, cacheKey, maxTimeInCacheBeforeExpiry);
    }
1293283
public void addProxy(String protocol, String host, int port, String username, String password) {
    Proxy proxy = new Proxy(protocol, host, port, username, password);
    proxies.add(proxy);
  }
267545
protected void processForwardConfig( HttpServletRequest request, HttpServletResponse response, ForwardConfig fwd )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
        FlowController fc = PageFlowRequestWrapper.get( request ).getCurrentFlowController();
        FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, fc );

        // Register this module as the one that's handling the action.
        if ( fc != null )
        {
            InternalUtils.setForwardingModule( request, fc.getModulePath() );
        }

        //
        // The following is similar to what's in super.processForwardConfig(), but it avoids putting
        // a slash in front of absolute URLs (e.g., ones that start with "http:").
        //
        if ( fwd != null )
        {
            if ( LOG.isDebugEnabled() ) LOG.debug( "processForwardConfig(" + fwd + ')' );

            //
            // Try to process a tiles definition. If the forward doesn't contain a
            // a tiles definition, continue on.
            //
            if ( processTilesDefinition( fwd.getPath(), fwd.getContextRelative(), request, response ) )
            {
                if ( log.isDebugEnabled() )
                {
                    log.debug( "  '" + fwd.getPath() + "' - processed as definition" );
                }
                return;
            }

            //
            // If this is a "special" page flow forward, create a Forward to handle it and pass
            // it to the current page flow.  This should only happen when processValidate()
            // calls this method (or if a plain Struts action forwards to this forward) --
            // otherwise, the page flow should be using a Forward already.
            //
            if ( fwd instanceof PageFlowActionForward )
            {
                ActionMapping mapping = ( ActionMapping ) request.getAttribute( Globals.MAPPING_KEY );
                assert mapping != null;
                ActionForm form = InternalUtils.getFormBean( mapping, request );
                Forward pfFwd = new Forward( ( ActionForward ) fwd, servletContext );
                ActionForwardHandler handler = _handlers.getActionForwardHandler();
                fwd = handler.processForward( context, pfFwd, mapping, null, InternalUtils.getActionName( mapping ),
                                              null, form );
            }

            String path = fwd.getPath();
            boolean startsWithSlash = path.length() > 0 && path.charAt( 0 ) == '/';

            //
            // If the URI is absolute (e.g., starts with "http:"), do a redirect to it no matter what.
            //
            if ( FileUtils.isAbsoluteURI( path ) )
            {
                fwdRedirectHandler.redirect( context, addScopeParams( path, request ) );
            }
            else if ( fwd.getRedirect() )
            {
                String redirectURI;

                if ( startsWithSlash && fwd instanceof Forward && ( ( Forward ) fwd ).isExplicitPath() )
                {
                    redirectURI = path;
                }
                else if ( fwd instanceof Forward && ( ( Forward ) fwd ).isExternalRedirect() )
                {
                    assert startsWithSlash : path; // compiler should ensure path starts with '/'
                    redirectURI = path;
                }
                else
                {
                    redirectURI = request.getContextPath() + RequestUtils.forwardURL( request, fwd );
                }

                fwdRedirectHandler.redirect( context, addScopeParams( redirectURI, request ) );
            }
            else
            {
                String fwdURI;

                if ( startsWithSlash && fwd instanceof Forward && ( ( Forward ) fwd ).isExplicitPath() )
                {
                    fwdURI = path;
                }
                else
                {
                    fwdURI = RequestUtils.forwardURL( request, fwd );

                    //
                    // First, see if the current module is a Shared Flow module.  If so, unless this is a forward to
                    // another action in the shared flow, we need to translate the local path so it makes sense (strip
                    // off the shared flow module prefix "/-" and replace it with "/").
                    //
                    ModuleConfig mc = ( ModuleConfig ) request.getAttribute( Globals.MODULE_KEY );

                    if ( InternalUtils.isSharedFlowModule( mc ) && ! fwdURI.endsWith( ACTION_EXTENSION )
                         && fwdURI.startsWith( SHARED_FLOW_MODULE_PREFIX ) )
                    {
                        fwdURI = '/' + fwdURI.substring( SHARED_FLOW_MODULE_PREFIX_LEN );
                    }
                }

                doForward( fwdURI, request, response );
            }
        }
    }
957184
private DefaultProxyRoutePlanner createProxyRoutePlanner(HttpSettings settings, HttpAsyncClientBuilder httpClientBuilder) {
        HttpHost proxy = new HttpHost(settings.getProxyUrl().getHost(), settings.getProxyUrl().getPort());
        if (settings.getProxyUser() != null) {
            CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            String proxyUser = settings.getProxyUser();
            String proxyPassword = settings.getProxyPassword();
            UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(proxyUser, proxyPassword);
            credentialsProvider.setCredentials(new AuthScope(proxy), credentials);
            httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
        }
        return new DefaultProxyRoutePlanner(proxy);
    }
1242063
public synchronized void pushExternalCacheFragment(ExternalInvalidation externalCacheFragment, DCache cache) {
        BatchUpdateList bul = getUpdateList(cache);
        bul.pushECFEvents.add(externalCacheFragment);
    }
113306
private void forward() {

        try {
            String macAddress = m_macAddress.getValue();
            String serverId = m_serverId.getValue();
            String serverUrl = m_serverUrl.getValue();
            CmsSetupBean setupBean = m_context.getSetupBean();
            setupBean.setEthernetAddress(macAddress);
            setupBean.setServerName(serverId);
            setupBean.setWorkplaceSite(serverUrl);
            setupBean.prepareStep8();
            m_context.stepForward();
        } catch (Exception e) {
            CmsSetupErrorDialog.showErrorDialog(e);

        }

    }
658387
def enable_cache():
    """"""
    try:
        import requests_cache
    except ImportError as err:
        sys.stderr.write('Failed to enable cache: {0}\n'.format(str(err)))
        return
    if not os.path.exists(CACHE_DIR):
        os.makedirs(CACHE_DIR)
    requests_cache.install_cache(CACHE_FILE)
1114600
public void setDefactoForwardedHeaders() {
        if (xForwardedForHeader != null && xForwardedByHeader != null) {
            httpOutboundRequest.setHeader(Constants.X_FORWARDED_FOR,
                    xForwardedForHeader.trim() + COMMA + " " + xForwardedByHeader.trim());
        } else if (xForwardedByHeader != null) {
            httpOutboundRequest.setHeader(Constants.X_FORWARDED_FOR, xForwardedByHeader.trim());
        }
        httpOutboundRequest.setHeader(Constants.X_FORWARDED_BY, localAddress);
    }
244654
def addLocalCacheService(self):
        ""
        _cache = self.getCacheService()
        _cache.setName('cache_proxy')
        _cache.setServiceParent(self.hendrix)
1179324
public ProxyBuilder<T> dexCache(File dexCacheParent) {
        dexCache = new File(dexCacheParent, "v" + Integer.toString(VERSION));
        dexCache.mkdir();
        return this;
    }
105849
public void addChildProxy(BaseProxy childProxy)
    {
        String strID = childProxy.getID();
        m_hmChildList.put(strID, childProxy);
    }
1032438
public void addCache(String cacheName, AsyncLoadingCache cache) {
        children.put(cacheName, cache.synchronous());
    }
393087
public synchronized void pushAliasEntry(AliasEntry aliasEntry, DCache cache) {
        BatchUpdateList bul = getUpdateList(cache);
        bul.aliasEntryEvents.add(aliasEntry);
    }
1238021
public void addProxy(String protocol, String host, int port, String username, String password,
                       int socketTimeout, int connectTimeout, int connectionRequestTimeout) {
    Proxy proxy = new Proxy(protocol, host, port, username, password, socketTimeout, connectTimeout, connectionRequestTimeout);
    proxies.add(proxy);
  }