internal CachedRawResponse(HttpRawResponse rawResponse, HttpCachePolicySettings settings, string kernelCacheUrl, Guid cachedVaryId)
 {
     this._rawResponse = rawResponse;
     this._settings = settings;
     this._kernelCacheUrl = kernelCacheUrl;
     this._cachedVaryId = cachedVaryId;
 }
 internal OutputCacheEntry(Guid cachedVaryId, HttpCachePolicySettings settings, string kernelCacheUrl, string dependenciesKey, string[] dependencies, int statusCode, string statusDescription, List<HeaderElement> headerElements, List<ResponseElement> responseElements)
 {
     this._cachedVaryId = cachedVaryId;
     this._settings = settings;
     this._kernelCacheUrl = kernelCacheUrl;
     this._dependenciesKey = dependenciesKey;
     this._dependencies = dependencies;
     this._statusCode = statusCode;
     this._statusDescription = statusDescription;
     this._headerElements = headerElements;
     this._responseElements = responseElements;
 }
        /*
         * Reset based on a cached response. Includes data needed to generate
         * header for a cached response.
         */
        internal void ResetFromHttpCachePolicySettings(
                HttpCachePolicySettings settings,
                DateTime                utcTimestampRequest) {

            int i, n;
            string[] fields;
            
            _utcTimestampRequest = utcTimestampRequest;

            _varyByContentEncodings.ResetFromContentEncodings(settings.VaryByContentEncodings);
            _varyByHeaders.ResetFromHeaders(settings.VaryByHeaders);                          
            _varyByParams.ResetFromParams(settings.VaryByParams);

            _isModified                       = settings.IsModified;                    
            _hasSetCookieHeader               = settings.hasSetCookieHeader;
            _noServerCaching                  = settings.NoServerCaching;               
            _cacheExtension                   = settings.CacheExtension;                
            _noTransforms                     = settings.NoTransforms;                  
            _ignoreRangeRequests              = settings.IgnoreRangeRequests;
            _varyByCustom                     = settings.VaryByCustom;
            _cacheability                     = settings.CacheabilityInternal;                  
            _noStore                          = settings.NoStore;
            _utcExpires                       = settings.UtcExpires;                       
            _isExpiresSet                     = settings.IsExpiresSet;                  
            _maxAge                           = settings.MaxAge;                        
            _isMaxAgeSet                      = settings.IsMaxAgeSet;                   
            _proxyMaxAge                      = settings.ProxyMaxAge;                   
            _isProxyMaxAgeSet                 = settings.IsProxyMaxAgeSet;              
            _slidingExpiration                = settings.SlidingExpirationInternal;             
            _slidingDelta                     = settings.SlidingDelta;
            _utcTimestampCreated              = settings.UtcTimestampCreated;
            _validUntilExpires                = settings.ValidUntilExpiresInternal;
            _allowInHistory                   = settings.AllowInHistoryInternal;
            _revalidation                     = settings.Revalidation;                  
            _utcLastModified                  = settings.UtcLastModified;                  
            _isLastModifiedSet                = settings.IsLastModifiedSet;             
            _etag                             = settings.ETag;                          
            _generateLastModifiedFromFiles    = settings.GenerateLastModifiedFromFiles; 
            _generateEtagFromFiles            = settings.GenerateEtagFromFiles;         
            _omitVaryStar                     = settings.OmitVaryStarInternal;
            _hasUserProvidedDependencies      = settings.HasUserProvidedDependencies;

            _useCachedHeaders = true;
            _headerCacheControl = settings.HeaderCacheControl;
            _headerPragma = settings.HeaderPragma;        
            _headerExpires = settings.HeaderExpires;       
            _headerLastModified = settings.HeaderLastModified;  
            _headerEtag = settings.HeaderEtag;          
            _headerVaryBy = settings.HeaderVaryBy;        

            _noMaxAgeInCacheControl = false;

            fields = settings.PrivateFields;
            if (fields != null) {
                _privateFields = new HttpDictionary();
                for (i = 0, n = fields.Length; i < n; i++) {
                    _privateFields.SetValue(fields[i], fields[i]);
                }
            }

            fields = settings.NoCacheFields;
            if (fields != null) {
                _noCacheFields = new HttpDictionary();
                for (i = 0, n = fields.Length; i < n; i++) {
                    _noCacheFields.SetValue(fields[i], fields[i]);
                }
            }

            if (settings.ValidationCallbackInfo != null) {
                _validationCallbackInfo = new ArrayList();
                for (i = 0, n = settings.ValidationCallbackInfo.Length; i < n; i++) {
                    _validationCallbackInfo.Add(new ValidationCallbackInfo(
                            settings.ValidationCallbackInfo[i].handler,
                            settings.ValidationCallbackInfo[i].data));
                }
            }
        }
Exemple #4
0
        internal void ResetFromHttpCachePolicySettings(HttpCachePolicySettings settings, DateTime utcTimestampRequest)
        {
            int num;
            int length;

            this._utcTimestampRequest = utcTimestampRequest;
            this._varyByContentEncodings.ResetFromContentEncodings(settings.VaryByContentEncodings);
            this._varyByHeaders.ResetFromHeaders(settings.VaryByHeaders);
            this._varyByParams.ResetFromParams(settings.VaryByParams);
            this._isModified          = settings.IsModified;
            this._hasSetCookieHeader  = settings.hasSetCookieHeader;
            this._noServerCaching     = settings.NoServerCaching;
            this._cacheExtension      = settings.CacheExtension;
            this._noTransforms        = settings.NoTransforms;
            this._ignoreRangeRequests = settings.IgnoreRangeRequests;
            this._varyByCustom        = settings.VaryByCustom;
            this._cacheability        = settings.CacheabilityInternal;
            this._noStore             = settings.NoStore;
            this._utcExpires          = settings.UtcExpires;
            this._isExpiresSet        = settings.IsExpiresSet;
            this._maxAge              = settings.MaxAge;
            this._isMaxAgeSet         = settings.IsMaxAgeSet;
            this._proxyMaxAge         = settings.ProxyMaxAge;
            this._isProxyMaxAgeSet    = settings.IsProxyMaxAgeSet;
            this._slidingExpiration   = settings.SlidingExpirationInternal;
            this._slidingDelta        = settings.SlidingDelta;
            this._utcTimestampCreated = settings.UtcTimestampCreated;
            this._validUntilExpires   = settings.ValidUntilExpiresInternal;
            this._allowInHistory      = settings.AllowInHistoryInternal;
            this._revalidation        = settings.Revalidation;
            this._utcLastModified     = settings.UtcLastModified;
            this._isLastModifiedSet   = settings.IsLastModifiedSet;
            this._etag = settings.ETag;
            this._generateLastModifiedFromFiles = settings.GenerateLastModifiedFromFiles;
            this._generateEtagFromFiles         = settings.GenerateEtagFromFiles;
            this._omitVaryStar = settings.OmitVaryStarInternal;
            this._hasUserProvidedDependencies = settings.HasUserProvidedDependencies;
            this._useCachedHeaders            = true;
            this._headerCacheControl          = settings.HeaderCacheControl;
            this._headerPragma           = settings.HeaderPragma;
            this._headerExpires          = settings.HeaderExpires;
            this._headerLastModified     = settings.HeaderLastModified;
            this._headerEtag             = settings.HeaderEtag;
            this._headerVaryBy           = settings.HeaderVaryBy;
            this._noMaxAgeInCacheControl = false;
            string[] privateFields = settings.PrivateFields;
            if (privateFields != null)
            {
                this._privateFields = new HttpDictionary();
                num    = 0;
                length = privateFields.Length;
                while (num < length)
                {
                    this._privateFields.SetValue(privateFields[num], privateFields[num]);
                    num++;
                }
            }
            privateFields = settings.NoCacheFields;
            if (privateFields != null)
            {
                this._noCacheFields = new HttpDictionary();
                num    = 0;
                length = privateFields.Length;
                while (num < length)
                {
                    this._noCacheFields.SetValue(privateFields[num], privateFields[num]);
                    num++;
                }
            }
            if (settings.ValidationCallbackInfo != null)
            {
                this._validationCallbackInfo = new ArrayList();
                num    = 0;
                length = settings.ValidationCallbackInfo.Length;
                while (num < length)
                {
                    this._validationCallbackInfo.Add(new ValidationCallbackInfo(settings.ValidationCallbackInfo[num].handler, settings.ValidationCallbackInfo[num].data));
                    num++;
                }
            }
        }
 internal CachedRawResponse(
           HttpRawResponse         rawResponse,
           HttpCachePolicySettings settings,
           String                  kernelCacheUrl,
           Guid                    cachedVaryId) {
     _rawResponse = rawResponse;
     _settings = settings;
     _kernelCacheUrl = kernelCacheUrl;
     _cachedVaryId = cachedVaryId;
 }