//----------------------------------------------------------------- private static void addToApplication(String key, Object val) { int minutes = DbConfig.Instance.ApplicationCacheMinutes; if (minutes == CacheTime.CacheForever) { appCache.Put(key, val); logger.Debug("APP_cache_+=>" + key); } else if (minutes > 0) { appCache.Put(key, val, minutes); logger.Debug("APP_cache_+=>" + key); } }
public virtual void Create() { String key = ctx.web.post("cacheKey"); String value = ctx.PostHtmlAll("cacheValue"); if (strUtil.IsNullOrEmpty(key)) { errors.Add("请填写cache key"); } if (strUtil.IsNullOrEmpty(value)) { errors.Add("请填写cache value"); } if (ctx.HasErrors) { echoError(); return; } _appCache.Put(key, value); echoToParentPart(lang("opok")); }