1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Web;
- namespace CB.Web.Kjh
- {
- /// <summary>
- /// 同步本地缓存
- /// </summary>
- public class SyncLocalCache : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- string cacheKey = context.Request.QueryString["cacheKey"];
- string passKey = context.Request.QueryString["passKey"];
- if (string.IsNullOrEmpty(cacheKey) || string.IsNullOrEmpty(passKey))
- {
- context.Response.Write("CacheKey or PassKey is not null!");
- return;
- }
- if (cacheKey != CB.Common.XXTEA.Decode(passKey))
- {
- context.Response.Write("AuthCode is not valid!");
- return;
- }
- //var cache = new CB.Cache.DefaultCacheStrategy();
- var cache = CB.Cache.CBCache.GetCacheService();
- cache.RemoveObject(cacheKey);
- context.Response.Write("OK");
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
- }
|