@@ -68,6 +68,15 @@ public string VaryByParam
6868 set ;
6969 }
7070
71+ /// <summary>
72+ /// Gets or sets the vary-by-header value.
73+ /// </summary>
74+ public string VaryByHeader
75+ {
76+ get ;
77+ set ;
78+ }
79+
7180 /// <summary>
7281 /// Gets or sets the vary-by-custom value.
7382 /// </summary>
@@ -262,12 +271,13 @@ protected CacheSettings BuildCacheSettings()
262271 cacheSettings = new CacheSettings
263272 {
264273 IsCachingEnabled = CacheSettingsManager . IsCachingEnabledGlobally ,
265- Duration = Duration ,
266- VaryByCustom = VaryByCustom ,
267- VaryByParam = VaryByParam ,
268- Location = ( int ) Location == - 1 ? OutputCacheLocation . Server : Location ,
269- NoStore = NoStore ,
270- Options = Options ,
274+ Duration = Duration ,
275+ VaryByCustom = VaryByCustom ,
276+ VaryByParam = VaryByParam ,
277+ VaryByHeader = VaryByHeader ,
278+ Location = ( int ) Location == - 1 ? OutputCacheLocation . Server : Location ,
279+ NoStore = NoStore ,
280+ Options = Options ,
271281 } ;
272282 }
273283 else
@@ -277,12 +287,13 @@ protected CacheSettings BuildCacheSettings()
277287 cacheSettings = new CacheSettings
278288 {
279289 IsCachingEnabled = CacheSettingsManager . IsCachingEnabledGlobally && cacheProfile . Enabled ,
280- Duration = Duration == - 1 ? cacheProfile . Duration : Duration ,
281- VaryByCustom = VaryByCustom ?? cacheProfile . VaryByCustom ,
282- VaryByParam = VaryByParam ?? cacheProfile . VaryByParam ,
283- Location = ( int ) Location == - 1 ? ( ( int ) cacheProfile . Location == - 1 ? OutputCacheLocation . Server : cacheProfile . Location ) : Location ,
284- NoStore = _noStore . HasValue ? _noStore . Value : cacheProfile . NoStore ,
285- Options = Options ,
290+ Duration = Duration == - 1 ? cacheProfile . Duration : Duration ,
291+ VaryByCustom = VaryByCustom ?? cacheProfile . VaryByCustom ,
292+ VaryByParam = VaryByParam ?? cacheProfile . VaryByParam ,
293+ VaryByHeader = VaryByHeader ?? cacheProfile . VaryByHeader ,
294+ Location = ( int ) Location == - 1 ? ( ( int ) cacheProfile . Location == - 1 ? OutputCacheLocation . Server : cacheProfile . Location ) : Location ,
295+ NoStore = _noStore . HasValue ? _noStore . Value : cacheProfile . NoStore ,
296+ Options = Options ,
286297 } ;
287298 }
288299
0 commit comments