Skip to content

Commit 07882be

Browse files
committed
explain activity-driven config refresh
1 parent 71aec57 commit 07882be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-javascript.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ Choose the following instructions based on how your application consumes configu
8080
```
8181
---
8282

83-
1. Add the following code to poll configuration changes of watched key-values every 5 seconds.
83+
1. Setting up `refreshOptions` alone won't automatically refresh the configuration. You need to call the `refresh` method to trigger a refresh. This design prevents unnecessary requests to App Configuration when your application is idle. You should include the `refresh` call where your application activity occurs. This is known as **activity-driven configuration refresh**. For example, you can call `refresh` when processing an incoming message or an order, or inside an iteration where you perform a complex task. Alternatively, you can use a timer if your application is always active. In this example, `refresh` is called in a loop for demonstration purposes. Even if the `refresh` call fails for any reason, your application will continue to use the cached configuration. Another attempt will be made when the configured refresh interval has passed and the `refresh` call is triggered by your application activity. Calling `refresh` is a no-op before the configured refresh interval elapses, so its performance impact is minimal even if it's called frequently.
84+
85+
Add the following code to poll configuration changes of watched key-values.
8486

8587
### [Use configuration as Map](#tab/configuration-map)
8688

0 commit comments

Comments
 (0)