예제 #1
0
        protected void BeginReceiveStreamFragments()
        {
#if !BESTHTTP_DISABLE_CACHING && (!UNITY_WEBGL || UNITY_EDITOR)
            if (!baseRequest.DisableCache && baseRequest.UseStreaming)
            {
                // If caching is enabled and the response not from cache and it's cacheble we will cache the downloaded data.
                if (!IsFromCache && HTTPCacheService.IsCacheble(baseRequest.CurrentUri, baseRequest.MethodType, this))
                {
                    cacheStream = HTTPCacheService.PrepareStreamed(baseRequest.CurrentUri, this);
                }
            }
#endif
            allFragmentSize = 0;
        }
예제 #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.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);
         }
     }
 }
예제 #3
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);
         }
     }
 }
예제 #4
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));
            }
        }
 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);
     }
 }
예제 #6
0
 protected void BeginReceiveStreamFragments()
 {
     if (!baseRequest.DisableCache && baseRequest.UseStreaming && !IsFromCache && HTTPCacheService.IsCacheble(baseRequest.CurrentUri, baseRequest.MethodType, this))
     {
         cacheStream = HTTPCacheService.PrepareStreamed(baseRequest.CurrentUri, this);
     }
     allFragmentSize = 0;
 }
예제 #7
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);
         }
     }
 }