public virtual IHtmlString Render(Page_Context pageContext, string positionId, string defaultHost, string defaultRequestPath, bool noProxy, CacheSettings cacheSetting) { string moduleURL = pageContext.PageRequestContext.ModuleUrlContext.GetModuleUrl(positionId); if (!string.IsNullOrEmpty(moduleURL)) { defaultRequestPath = moduleURL.Trim('~'); } var httpMethod = pageContext.ControllerContext.HttpContext.Request.HttpMethod; if (!defaultHost.StartsWith("http://")) { defaultHost = "http://" + defaultHost; } var requestUrl = UrlUtility.Combine(defaultHost, defaultRequestPath); Func <IHtmlString> getHtml = () => { Func <string, bool, string> proxyUrl = null; if (!noProxy) { proxyUrl = (url, isForm) => GenerateProxyUrl(pageContext, positionId, url, isForm); } if (httpMethod.ToUpper() == "POST") { var postModule = pageContext.PageRequestContext.AllQueryString[Kooboo.CMS.Sites.View.ModuleUrlContext.PostModuleParameter]; if (postModule != positionId) { httpMethod = "GET"; } } var html = _webProxy.ProcessRequest(pageContext.ControllerContext.HttpContext, requestUrl, httpMethod, proxyUrl); return(html); }; if (cacheSetting != null && cacheSetting.EnableCaching != null && cacheSetting.EnableCaching == true && httpMethod.ToUpper() == "GET") { string cacheKey = string.Format("{0}-{1}-{2}", positionId, requestUrl, noProxy); return(pageContext.PageRequestContext.Site.ObjectCache().GetCache(cacheKey, getHtml, cacheSetting.ToCachePolicy())); } else { return(getHtml()); } }