140 references to CacheEntry
System (140)
net\System\Net\_FtpControlStream.cs (2)
590
if (request.CacheProtocol.Validator.
CacheEntry
.StreamSize > 0)
591
commandList.Add(new PipelineEntry(FormatFtpCommand("REST", request.CacheProtocol.Validator.
CacheEntry
.StreamSize.ToString(CultureInfo.InvariantCulture))));
net\System\Net\Cache\_RequestCacheProtocol.cs (21)
345
if (_Validator.CacheStreamOffset != 0L || _Validator.CacheStreamLength != _Validator.
CacheEntry
.StreamSize)
487
if (_Validator.CacheStreamOffset != 0L || _Validator.CacheStreamLength != _Validator.
CacheEntry
.StreamSize)
560
if (_Validator.
CacheEntry
== null)
592
_Validator.
CacheEntry
.ExpiresUtc,
593
_Validator.
CacheEntry
.LastModifiedUtc,
594
_Validator.
CacheEntry
.LastSynchronizedUtc,
595
_Validator.
CacheEntry
.MaxStale,
596
_Validator.
CacheEntry
.EntryMetadata,
597
_Validator.
CacheEntry
.SystemMetadata,
615
{stream = _RequestCache.Store(_Validator.CacheKey, _Validator.
CacheEntry
.StreamSize, _Validator.
CacheEntry
.ExpiresUtc, _Validator.
CacheEntry
.LastModifiedUtc, _Validator.
CacheEntry
.MaxStale, _Validator.
CacheEntry
.EntryMetadata, _Validator.
CacheEntry
.SystemMetadata);}
617
{_RequestCache.TryStore(_Validator.CacheKey, _Validator.
CacheEntry
.StreamSize, _Validator.
CacheEntry
.ExpiresUtc, _Validator.
CacheEntry
.LastModifiedUtc, _Validator.
CacheEntry
.MaxStale, _Validator.
CacheEntry
.EntryMetadata, _Validator.
CacheEntry
.SystemMetadata, out stream);}
net\System\Net\Cache\_Rfc2616CacheValidators.cs (51)
131
if (ctx.CacheHeaders.Expires == null && (ctx.
CacheEntry
.IsPrivateEntry?ctx.CacheCacheControl.MaxAge == -1:ctx.CacheCacheControl.SMaxAge == -1)) {
355
ctx.
CacheEntry
.IsPartialEntry = false;
366
ctx.
CacheEntry
.ExpiresUtc = ctx.ResponseExpires;
367
ctx.
CacheEntry
.LastModifiedUtc = ctx.ResponseLastModified;
369
ctx.
CacheEntry
.MaxStale = ctx.Policy.MaxStale;
372
ctx.
CacheEntry
.MaxStale = TimeSpan.MinValue;
374
ctx.
CacheEntry
.LastSynchronizedUtc = DateTime.UtcNow;
384
if (ctx.
CacheEntry
.StreamSize != ctx.ResponseRangeStart && ctx.ResponseRangeStart != 0)
386
if(Logging.On)Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_partial_resp_not_combined_with_existing_entry, ctx.
CacheEntry
.StreamSize, ctx.ResponseRangeStart));
402
ctx.CacheStreamLength = ctx.
CacheEntry
.StreamSize = ctx.ResponseRangeEnd+1;
403
if (ctx.CacheEntityLength > 0 && ctx.CacheEntityLength == ctx.
CacheEntry
.StreamSize)
418
ctx.
CacheEntry
.StreamSize = resp.ContentLength;
516
else if (ctx.
CacheEntry
.LastSynchronizedUtc != DateTime.MinValue) {
520
age = nowDate - ctx.
CacheEntry
.LastSynchronizedUtc;
526
Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_age1_last_synchronized_age_header, ((int)age.TotalSeconds).ToString(NumberFormatInfo.InvariantInfo), ctx.
CacheEntry
.LastSynchronizedUtc.ToString("r", CultureInfo.InvariantCulture), ((int)ctx.CacheAge.TotalSeconds).ToString(NumberFormatInfo.InvariantInfo)));
528
Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_age1_last_synchronized, ((int)age.TotalSeconds).ToString(NumberFormatInfo.InvariantInfo), ctx.
CacheEntry
.LastSynchronizedUtc.ToString("r", CultureInfo.InvariantCulture)));
565
if (!ctx.
CacheEntry
.IsPrivateEntry && ctx.CacheCacheControl.SMaxAge != -1) {
594
date = ctx.
CacheEntry
.LastSynchronizedUtc;
597
DateTime expiresDate = ctx.
CacheEntry
.ExpiresUtc;
640
DateTime lastModifiedDate = ctx.
CacheEntry
.LastModifiedUtc;
767
if (!ctx.
CacheEntry
.IsPrivateEntry) {
816
if (!ctx.
CacheEntry
.IsPrivateEntry && ctx.Request.Headers[HttpKnownHeaderNames.Authorization] != null) {
899
if(Logging.On)Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_policy_cache_sync_date, ctx.Policy.InternalCacheSyncDateUtc.ToString("r", CultureInfo.CurrentCulture), ctx.
CacheEntry
.LastSynchronizedUtc.ToString(CultureInfo.CurrentCulture)));
900
if (ctx.
CacheEntry
.LastSynchronizedUtc < ctx.Policy.InternalCacheSyncDateUtc) {
985
(!ctx.
CacheEntry
.IsPrivateEntry && ctx.CacheCacheControl.ProxyRevalidate))
1024
if (!ctx.
CacheEntry
.IsPrivateEntry && ctx.CacheCacheControl.SMaxAge == -1 && !ctx.CacheCacheControl.MustRevalidate && !ctx.CacheCacheControl.Public) {
1106
if (ctx.
CacheEntry
.StreamSize != ctx.ResponseRangeStart) {
1117
ctx.CacheStreamOffset = ctx.
CacheEntry
.StreamSize;
1276
if (ctx.CacheEntityLength != ctx.
CacheEntry
.StreamSize || ctx.CacheStatusCode == HttpStatusCode.PartialContent) {
1429
((HttpWebRequest)ctx.Request).AddRange((int)ctx.
CacheEntry
.StreamSize);
1465
if (start >= ctx.
CacheEntry
.StreamSize
1466
|| end > ctx.
CacheEntry
.StreamSize
1468
|| (end == -1 && ctx.CacheEntityLength > ctx.
CacheEntry
.StreamSize)
1471
|| (ctx.CacheEntityLength - end >= ctx.
CacheEntry
.StreamSize))))
1483
end = ctx.
CacheEntry
.StreamSize - 1;
1504
ctx.CacheStreamLength = ctx.
CacheEntry
.StreamSize;
1511
if (ctx.
CacheEntry
.StreamSize >= Int32.MaxValue) {
1512
if(Logging.On)Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_entry_size_too_big, ctx.
CacheEntry
.StreamSize));
1518
((HttpWebRequest)ctx.Request).AddRange((int)ctx.
CacheEntry
.StreamSize);
1543
if (ctx.CacheStatusCode == HttpStatusCode.PartialContent && ctx.CacheEntityLength == ctx.
CacheEntry
.StreamSize)
1550
if (ctx.
CacheEntry
.IsPartialEntry || (ctx.CacheEntityLength != -1 && ctx.CacheEntityLength != ctx.
CacheEntry
.StreamSize) || ctx.CacheStatusCode == HttpStatusCode.PartialContent)
1552
if(Logging.On)Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_could_be_partial, ctx.
CacheEntry
.StreamSize, ctx.CacheEntityLength));
1603
if (ctx.
CacheEntry
.LastModifiedUtc != DateTime.MinValue) {
1605
str = ctx.
CacheEntry
.LastModifiedUtc.ToString("r", CultureInfo.InvariantCulture);
1636
if (ctx.
CacheEntry
.StreamSize >= Int32.MaxValue) {
1638
if(Logging.On)Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_entry_size_too_big, ctx.
CacheEntry
.StreamSize));
1665
if (ctx.
CacheEntry
.LastModifiedUtc != DateTime.MinValue)
1667
str = ctx.
CacheEntry
.LastModifiedUtc.ToString("r", CultureInfo.InvariantCulture);
1712
ctx.
CacheEntry
.IsPartialEntry = true;
1729
ctx.
CacheEntry
.IsPartialEntry = false;
net\System\Net\Cache\FtpRequestCacheValidator.cs (37)
127
if (
CacheEntry
.EntryMetadata == null)
128
CacheEntry
.EntryMetadata = new StringCollection();
130
CacheEntry
.EntryMetadata.Clear();
131
CacheEntry
.EntryMetadata.Add("HTTP/1.1 200 OK");
141
if (
CacheEntry
.ExpiresUtc != DateTime.MinValue)
144
if(Logging.On)Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_max_age_absolute,
CacheEntry
.ExpiresUtc.ToString("r", CultureInfo.InvariantCulture)));
145
if (
CacheEntry
.ExpiresUtc < nowDate) {
153
if(
CacheEntry
.LastSynchronizedUtc != DateTime.MinValue)
155
age = nowDate -
CacheEntry
.LastSynchronizedUtc;
156
if(Logging.On)Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_age1, ((int)age.TotalSeconds).ToString(NumberFormatInfo.InvariantInfo),
CacheEntry
.LastSynchronizedUtc.ToString("r", CultureInfo.InvariantCulture)));
162
if (
CacheEntry
.LastModifiedUtc != DateTime.MinValue)
164
TimeSpan span = (nowDate -
CacheEntry
.LastModifiedUtc);
166
if(Logging.On)Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_no_max_age_use_10_percent, maxAgeSeconds.ToString(NumberFormatInfo.InvariantInfo),
CacheEntry
.LastModifiedUtc.ToString("r", CultureInfo.InvariantCulture)));
199
if (CacheStream == Stream.Null ||
CacheEntry
.IsPartialEntry)
214
CacheStreamLength =
CacheEntry
.StreamSize;
219
if (Policy.Level == RequestCacheLevel.Revalidate ||
CacheEntry
.IsPartialEntry)
285
if(Logging.On) Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_cache_last_modified,
CacheEntry
.LastModifiedUtc.ToString("r", CultureInfo.InvariantCulture),
CacheEntry
.StreamSize));
287
if (CacheStreamOffset != 0L &&
CacheEntry
.IsPartialEntry)
294
if (resp.LastModified.ToUniversalTime() ==
CacheEntry
.LastModifiedUtc)
296
if (
CacheEntry
.IsPartialEntry)
307
else if (resp.ContentLength ==
CacheEntry
.StreamSize)
442
if (
CacheEntry
.LastModifiedUtc != DateTime.MinValue && resp.LastModified.ToUniversalTime() !=
CacheEntry
.LastModifiedUtc)
444
if(Logging.On)Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_removed_entry_because_ftp_restart_response_changed,
CacheEntry
.LastModifiedUtc.ToString("r", CultureInfo.InvariantCulture), resp.LastModified.ToUniversalTime().ToString("r", CultureInfo.InvariantCulture)));
458
CacheEntry
.EntryMetadata = null;
459
CacheEntry
.SystemMetadata = null;
464
CacheEntry
.LastModifiedUtc = resp.LastModified.ToUniversalTime();
468
CacheEntry
.StreamSize = ResponseEntityLength; //This is passed down to cache on what size to expect
469
CacheEntry
.LastSynchronizedUtc = DateTime.UtcNow;
476
if(Logging.On)Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_last_synchronized,
CacheEntry
.LastSynchronizedUtc.ToString("r", CultureInfo.InvariantCulture)));
479
if (
CacheEntry
.LastSynchronizedUtc + TimeSpan.FromMinutes(1) >= nowUtc)
485
CacheEntry
.EntryMetadata = null;
486
CacheEntry
.SystemMetadata = null;
488
CacheEntry
.LastSynchronizedUtc = nowUtc;
490
if(Logging.On)Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_updating_last_synchronized,
CacheEntry
.LastSynchronizedUtc.ToString("r", CultureInfo.InvariantCulture)));
504
if (
CacheEntry
.IsPartialEntry || request.ContentOffset >= CacheStreamLength)
net\System\Net\Cache\HttpRequestCacheValidator.cs (25)
289
CacheStreamLength =
CacheEntry
.StreamSize;
480
CacheEntry
.EntryMetadata = null;
481
CacheEntry
.SystemMetadata = null;
488
CacheEntry
.EntryMetadata = new StringCollection();
489
CacheEntry
.SystemMetadata = new StringCollection();
505
CacheEntry
.EntryMetadata.Add(sb.ToString());
507
UpdateStringCollection(
CacheEntry
.EntryMetadata, CacheHeaders, false);
511
UpdateStringCollection(
CacheEntry
.SystemMetadata, SystemMeta, true);
516
CacheEntry
.ExpiresUtc = ResponseExpires;
521
CacheEntry
.LastModifiedUtc = ResponseLastModified;
526
CacheEntry
.MaxStale = this.Policy.MaxStale;
529
CacheEntry
.LastSynchronizedUtc = DateTime.UtcNow;
573
if (
CacheEntry
.EntryMetadata == null ||
CacheEntry
.EntryMetadata.Count == 0)
578
string s =
CacheEntry
.EntryMetadata[0];
639
if (
CacheEntry
.EntryMetadata == null ||
CacheEntry
.EntryMetadata.Count == 0)
645
string s = ParseNameValues(CacheHeaders,
CacheEntry
.EntryMetadata, ignoreFirstString?1:0);
657
SystemMeta = new NameValueCollection((
CacheEntry
.EntryMetadata == null ||
CacheEntry
.EntryMetadata.Count == 0? 2:
CacheEntry
.EntryMetadata.Count),
660
if (
CacheEntry
.EntryMetadata == null ||
CacheEntry
.EntryMetadata.Count == 0)
663
string s = ParseNameValues(SystemMeta,
CacheEntry
.SystemMetadata, 0);
804
else if (forCache && totalLength ==
CacheEntry
.StreamSize)
net\System\Net\FtpWebRequest.cs (4)
2082
ctx.
CacheEntry
.LastModifiedUtc == DateTime.MinValue? DateTime.Now: ctx.
CacheEntry
.LastModifiedUtc.ToLocalTime(),
2149
ctx.
CacheEntry
.LastModifiedUtc == DateTime.MinValue? DateTime.Now: ctx.
CacheEntry
.LastModifiedUtc.ToLocalTime(),