@@ -81,7 +81,7 @@ type SettingSelectorCollection = {
8181 * It can either be the page etag or etag of a watched setting depending on the refresh monitoring strategy.
8282 * When a watched setting is deleted, the token value will be SHA-256 hash of `ResourceDeleted\n{previous-etag}`.
8383 */
84- cdnCacheConsistencyToken ?: string ;
84+ cdnToken ?: string ;
8585}
8686
8787export class AzureAppConfigurationImpl implements AzureAppConfiguration {
@@ -504,10 +504,10 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
504504 } ;
505505
506506 // 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 ) {
508508 listOptions = {
509509 ...listOptions ,
510- requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnCacheConsistencyToken } }
510+ requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnToken } }
511511 } ;
512512 }
513513 const pageEtags : string [ ] = [ ] ;
@@ -617,8 +617,8 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
617617 // Send a request to retrieve watched key-value since it may be either not loaded or loaded with a different selector
618618 // If CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
619619 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 } } } ;
622622 }
623623 const response = await this . #getConfigurationSetting( sentinel , getOptions ) ;
624624 sentinel . etag = response ?. etag ;
@@ -677,10 +677,10 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
677677 for ( const sentinel of this . #sentinels. values ( ) ) {
678678 // if CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
679679 let getOptions : GetConfigurationSettingOptions = { } ;
680- if ( this . #isCdnUsed && this . #kvSelectorCollection. cdnCacheConsistencyToken ) {
680+ if ( this . #isCdnUsed && this . #kvSelectorCollection. cdnToken ) {
681681 // if CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
682682 getOptions = {
683- requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : this . #kvSelectorCollection. cdnCacheConsistencyToken ?? "" } } ,
683+ requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : this . #kvSelectorCollection. cdnToken ?? "" } } ,
684684 } ;
685685 }
686686 // send conditional request only when CDN is not used
@@ -690,10 +690,10 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
690690 ( response === undefined && sentinel . etag !== undefined ) // deleted
691691 ) {
692692 if ( response === undefined ) {
693- this . #kvSelectorCollection. cdnCacheConsistencyToken =
693+ this . #kvSelectorCollection. cdnToken =
694694 await this . #calculateResourceDeletedCacheConsistencyToken( sentinel . etag ! ) ;
695695 } else {
696- this . #kvSelectorCollection. cdnCacheConsistencyToken = response . etag ;
696+ this . #kvSelectorCollection. cdnToken = response . etag ;
697697 }
698698 sentinel . etag = response ?. etag ; // update etag of the sentinel
699699 needRefresh = true ;
@@ -750,11 +750,11 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
750750 ...listOptions ,
751751 pageEtags : selector . pageEtags
752752 } ;
753- } else if ( selectorCollection . cdnCacheConsistencyToken ) {
753+ } else if ( selectorCollection . cdnToken ) {
754754 // If CDN is used, add etag to request header so that the pipeline policy can retrieve and append it to the request URL
755755 listOptions = {
756756 ...listOptions ,
757- requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnCacheConsistencyToken } }
757+ requestOptions : { customHeaders : { [ ETAG_LOOKUP_HEADER ] : selectorCollection . cdnToken } }
758758 } ;
759759 }
760760
@@ -775,15 +775,15 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
775775 // 100 kvs will return two pages, one page with 100 items and another empty page
776776 // kv collection change will always be detected by page etag change
777777 if ( this . #isCdnUsed) {
778- selectorCollection . cdnCacheConsistencyToken = page . etag ;
778+ selectorCollection . cdnToken = page . etag ;
779779 }
780780 return true ;
781781 }
782782 i ++ ;
783783 }
784784 if ( i !== selector . pageEtags . length ) { // page removed
785785 if ( this . #isCdnUsed) {
786- selectorCollection . cdnCacheConsistencyToken = selector . pageEtags [ i ] ;
786+ selectorCollection . cdnToken = selector . pageEtags [ i ] ;
787787 }
788788 return true ;
789789 }
0 commit comments