/// <summary> /// 检查或设置客户端缓存(后台启用缓存并设时间>0) /// </summary> /// <returns></returns> public bool CheckAndSetClientCache() { if (Settings.Opti_ClientCache && Settings.Opti_ClientCacheSeconds > 0) { if (CacheUtil.CheckClientCacheExpires(Settings.Opti_ClientCacheSeconds)) { CacheUtil.SetClientCache(this.Response, Settings.Opti_ClientCacheSeconds); } else { return(false); } } return(true); }
/// <summary> /// 检查或设置客户端缓存(自定义时间,单位:秒) /// </summary> /// <returns></returns> public bool CheckAndSetClientCache(int maxAge) { if (maxAge > 0) { if (CacheUtil.CheckClientCacheExpires(maxAge)) { CacheUtil.SetClientCache(this.Response, maxAge); } else { return(false); } } return(true); }
// public bool CheckSiteState() // { // if (this.CurrentSite.State == SiteState.Normal) // { // return true; // } // else if (this.CurrentSite.State == SiteState.Closed) // { // this.RenderNotfound(); // } // else if (this.CurrentSite.State == SiteState.Paused) // { // this.Render("<h1 style=\"color:red;text-align:center;font-size:16px;padding:20px\">网站维护中,暂停访问!</h1>"); // //this.RenderNotfound("<h1 style=\"color:red\">网站维护中,暂停访问!</h1>"); // } // return false; // } /// <summary> /// 检查或设置客户端缓存(后台启用缓存并设时间>0) /// </summary> /// <returns></returns> public bool CheckAndSetClientCache() { if (WebConf.Opti_ClientCache && WebConf.Opti_ClientCacheSeconds > 0) { if (CacheUtil.CheckClientCacheExpires(WebConf.Opti_ClientCacheSeconds)) { CacheUtil.SetClientCache(this._context.Response, WebConf.Opti_ClientCacheSeconds); } else { return(false); } } return(true); }
public bool CheckClientCacheExpiresByEtag() { return(CacheUtil.CheckClientCacheExpires(cacheSha1ETag)); }
public bool CheckClientCacheExpires(int seconds) { return(CacheUtil.CheckClientCacheExpires(seconds)); }