SyncLocalCache.ashx.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web;
  4. namespace CB.Wap
  5. {
  6. /// <summary>
  7. /// SyncLocalCache 的摘要说明
  8. /// </summary>
  9. public class SyncLocalCache : IHttpHandler
  10. {
  11. public void ProcessRequest(HttpContext context)
  12. {
  13. context.Response.ContentType = "text/plain";
  14. string cacheKey = context.Request.QueryString["cacheKey"];
  15. string passKey = context.Request.QueryString["passKey"];
  16. if (string.IsNullOrEmpty(cacheKey) || string.IsNullOrEmpty(passKey))
  17. {
  18. context.Response.Write("CacheKey or PassKey is not null!");
  19. return;
  20. }
  21. if (cacheKey != CB.Common.XXTEA.Decode(passKey))
  22. {
  23. context.Response.Write("AuthCode is not valid!");
  24. return;
  25. }
  26. //var cache = new CB.Cache.DefaultCacheStrategy();
  27. var cache = CB.Cache.CBCache.GetCacheService();
  28. cache.RemoveObject(cacheKey);
  29. context.Response.Write("OK");
  30. }
  31. public bool IsReusable
  32. {
  33. get
  34. {
  35. return false;
  36. }
  37. }
  38. }
  39. }