Skip to content

Commit 8bfe705

Browse files
add caching info to config article
1 parent ab42f1b commit 8bfe705

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

articles/static-web-apps/configuration.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,24 @@ In addition to IP address blocks, you can also specify [service tags](../virtual
316316
* [Default authentication providers](authentication-authorization.md#login), don't require settings in the configuration file.
317317
* [Custom authentication providers](authentication-custom.md) use the `auth` section of the settings file.
318318

319+
## Disable cache for authenticated paths
320+
321+
If you have enabled enterprise-grade edge, or set up manual integration with Azure Front Door, you may want to disable caching for your secured routes.
322+
323+
To disable Azure Front Door caching for secured routes, add `"Cache-Control": "no-store"` to the route header definition.
324+
325+
For example:
326+
327+
```json
328+
{
329+
"route": "/members",
330+
"allowedRoles": ["authenticated, members"],
331+
"headers": {
332+
"Cache-Control": "no-store"
333+
}
334+
}
335+
```
336+
319337
## Forwarding gateway
320338

321339
The `forwardingGateway` section configures how a static web app is accessed from a forwarding gateway such as a CDN or Azure Front Door.
@@ -357,7 +375,7 @@ For example, the following configuration shows how you can add a unique identifi
357375

358376
- Key/value pairs can be any set of arbitrary strings
359377
- Keys are case insensitive
360-
- Values are case sensitive
378+
- Values are case-sensitive
361379

362380
## Example configuration file
363381

articles/static-web-apps/front-door-manual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Open the [staticwebapp.config.json](configuration.md) file for your site and mak
172172

173173
In this example, replace `my-sitename.azurefd.net` with the Azure Front Door hostname for your site.
174174

175-
1. For all secured routes in your app, disable Azure Front Door caching by adding `"Cache-Control": "no-store"` to the route definition.
175+
1. For all secured routes in your app, disable Azure Front Door caching by adding `"Cache-Control": "no-store"` to the route header definition.
176176

177177
```json
178178
{

0 commit comments

Comments
 (0)