private void TryStoreInCache()
 {
     if (!CurrentRequest.UseStreaming && !CurrentRequest.DisableCache && CurrentRequest.Response != null && HTTPCacheService.IsCacheble(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response))
     {
         HTTPCacheService.Store(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response);
     }
 }
Exemplo n.º 2
0
 private void TryStoreInCache()
 {
     // if UseStreaming && !DisableCache then we already wrote the response to the cache
     if (!CurrentRequest.UseStreaming &&
         !CurrentRequest.DisableCache &&
         CurrentRequest.Response != null &&
         HTTPCacheService.IsCacheble(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response))
     {
         HTTPCacheService.Store(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response);
     }
 }
Exemplo n.º 3
0
 private void TryStoreInCache()
 {
     if (((!base.CurrentRequest.UseStreaming && !base.CurrentRequest.DisableCache) && ((base.CurrentRequest.Response != null) && HTTPCacheService.IsSupported)) && HTTPCacheService.IsCacheble(base.CurrentRequest.CurrentUri, base.CurrentRequest.MethodType, base.CurrentRequest.Response))
     {
         if (base.CurrentRequest.IsRedirected)
         {
             HTTPCacheService.Store(base.CurrentRequest.Uri, base.CurrentRequest.MethodType, base.CurrentRequest.Response);
         }
         else
         {
             HTTPCacheService.Store(base.CurrentRequest.CurrentUri, base.CurrentRequest.MethodType, base.CurrentRequest.Response);
         }
     }
 }
Exemplo n.º 4
0
 private void TryStoreInCache()
 {
     // if UseStreaming && !DisableCache then we already wrote the response to the cache
     if (!CurrentRequest.UseStreaming &&
         !CurrentRequest.DisableCache &&
         CurrentRequest.Response != null &&
         HTTPCacheService.IsSupported &&
         HTTPCacheService.IsCacheble(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response))
     {
         if (CurrentRequest.CacheTime > 0)
         {
             CurrentRequest.Response.AddHeader("cache-control", "public, max-age=" + CurrentRequest.CacheTime);
             HTTPCacheService.Store(CurrentRequest, CurrentRequest.MethodType, CurrentRequest.Response);
         }
     }
 }
Exemplo n.º 5
0
 private void TryStoreInCache()
 {
     // if UseStreaming && !DisableCache then we already wrote the response to the cache
     if (!CurrentRequest.UseStreaming &&
         !CurrentRequest.DisableCache &&
         CurrentRequest.Response != null &&
         HTTPCacheService.IsSupported &&
         HTTPCacheService.IsCacheble(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response))
     {
         if (CurrentRequest.IsRedirected)
         {
             HTTPCacheService.Store(CurrentRequest.Uri, CurrentRequest.MethodType, CurrentRequest.Response);
         }
         else
         {
             HTTPCacheService.Store(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response);
         }
         HTTPCacheService.SaveLibrary();
     }
 }
Exemplo n.º 6
0
        public static void TryStoreInCache(HTTPRequest request)
        {
            // if UseStreaming && !DisableCache then we already wrote the response to the cache
            if (!request.UseStreaming &&
                !request.DisableCache &&
                request.Response != null &&
                HTTPCacheService.IsSupported &&
                HTTPCacheService.IsCacheble(request.CurrentUri, request.MethodType, request.Response))
            {
                if (request.IsRedirected)
                {
                    HTTPCacheService.Store(request.Uri, request.MethodType, request.Response);
                }
                else
                {
                    HTTPCacheService.Store(request.CurrentUri, request.MethodType, request.Response);
                }

                PluginEventHelper.EnqueuePluginEvent(new PluginEventInfo(PluginEvents.SaveCacheLibrary));
            }
        }