Skip to content

Commit bd1c875

Browse files
only send conditional request when cdn is not used
1 parent 62ac2b9 commit bd1c875

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AzureAppConfigurationImpl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,11 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
421421
let needRefresh = false;
422422
for (const sentinel of this.#sentinels.values()) {
423423
const response = await this.#getConfigurationSetting(sentinel, {
424-
onlyIfChanged: true
424+
onlyIfChanged: !this.#isCdnUsed // if CDN is used, do not send conditional request
425425
});
426426

427-
if (response?.statusCode === 200 // created or changed
428-
|| (response === undefined && sentinel.etag !== undefined) // deleted
427+
if ((response?.statusCode === 200 && sentinel.etag !== response?.etag) ||
428+
(response === undefined && sentinel.etag !== undefined) // deleted
429429
) {
430430
sentinel.etag = response?.etag;// update etag of the sentinel
431431
needRefresh = true;

0 commit comments

Comments
 (0)