@@ -81,7 +81,7 @@ type SettingSelectorCollection = {
81
81
* It can either be the page etag or etag of a watched setting depending on the refresh monitoring strategy.
82
82
* When a watched setting is deleted, the token value will be SHA-256 hash of `ResourceDeleted\n{previous-etag}`.
83
83
*/
84
- cdnCacheConsistencyToken ?: string ;
84
+ cdnToken ?: string ;
85
85
}
86
86
87
87
export class AzureAppConfigurationImpl implements AzureAppConfiguration {
@@ -504,10 +504,10 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
504
504
} ;
505
505
506
506
// If CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
507
- if ( this . #isCdnUsed && selectorCollection . cdnCacheConsistencyToken ) {
507
+ if ( this . #isCdnUsed && selectorCollection . cdnToken ) {
508
508
listOptions = {
509
509
...listOptions ,
510
- requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnCacheConsistencyToken } }
510
+ requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnToken } }
511
511
} ;
512
512
}
513
513
const pageEtags : string [ ] = [ ] ;
@@ -617,8 +617,8 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
617
617
// Send a request to retrieve watched key-value since it may be either not loaded or loaded with a different selector
618
618
// If CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
619
619
let getOptions : GetConfigurationSettingOptions = { } ;
620
- if ( this . #isCdnUsed && this . #kvSelectorCollection. cdnCacheConsistencyToken ) {
621
- getOptions = { requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : this . #kvSelectorCollection. cdnCacheConsistencyToken } } } ;
620
+ if ( this . #isCdnUsed && this . #kvSelectorCollection. cdnToken ) {
621
+ getOptions = { requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : this . #kvSelectorCollection. cdnToken } } } ;
622
622
}
623
623
const response = await this . #getConfigurationSetting( sentinel , getOptions ) ;
624
624
sentinel . etag = response ?. etag ;
@@ -677,10 +677,10 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
677
677
for ( const sentinel of this . #sentinels. values ( ) ) {
678
678
// if CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
679
679
let getOptions : GetConfigurationSettingOptions = { } ;
680
- if ( this . #isCdnUsed && this . #kvSelectorCollection. cdnCacheConsistencyToken ) {
680
+ if ( this . #isCdnUsed && this . #kvSelectorCollection. cdnToken ) {
681
681
// if CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
682
682
getOptions = {
683
- requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : this . #kvSelectorCollection. cdnCacheConsistencyToken ?? "" } } ,
683
+ requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : this . #kvSelectorCollection. cdnToken ?? "" } } ,
684
684
} ;
685
685
}
686
686
// send conditional request only when CDN is not used
@@ -690,10 +690,10 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
690
690
( response === undefined && sentinel . etag !== undefined ) // deleted
691
691
) {
692
692
if ( response === undefined ) {
693
- this . #kvSelectorCollection. cdnCacheConsistencyToken =
693
+ this . #kvSelectorCollection. cdnToken =
694
694
await this . #calculateResourceDeletedCacheConsistencyToken( sentinel . etag ! ) ;
695
695
} else {
696
- this . #kvSelectorCollection. cdnCacheConsistencyToken = response . etag ;
696
+ this . #kvSelectorCollection. cdnToken = response . etag ;
697
697
}
698
698
sentinel . etag = response ?. etag ; // update etag of the sentinel
699
699
needRefresh = true ;
@@ -750,11 +750,11 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
750
750
...listOptions ,
751
751
pageEtags : selector . pageEtags
752
752
} ;
753
- } else if ( selectorCollection . cdnCacheConsistencyToken ) {
753
+ } else if ( selectorCollection . cdnToken ) {
754
754
// If CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
755
755
listOptions = {
756
756
...listOptions ,
757
- requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnCacheConsistencyToken } }
757
+ requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnToken } }
758
758
} ;
759
759
}
760
760
@@ -775,15 +775,15 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
775
775
// 100 kvs will return two pages, one page with 100 items and another empty page
776
776
// kv collection change will always be detected by page etag change
777
777
if ( this . #isCdnUsed) {
778
- selectorCollection . cdnCacheConsistencyToken = page . etag ;
778
+ selectorCollection . cdnToken = page . etag ;
779
779
}
780
780
return true ;
781
781
}
782
782
i ++ ;
783
783
}
784
784
if ( i !== selector . pageEtags . length ) { // page removed
785
785
if ( this . #isCdnUsed) {
786
- selectorCollection . cdnCacheConsistencyToken = selector . pageEtags [ i ] ;
786
+ selectorCollection . cdnToken = selector . pageEtags [ i ] ;
787
787
}
788
788
return true ;
789
789
}
0 commit comments