Skip to content

Commit ab42f1b

Browse files
disable cache in config
1 parent 02ea57a commit ab42f1b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: static-web-apps
55
author: craigshoemaker
66
ms.service: static-web-apps
77
ms.topic: how-to
8-
ms.date: 01/07/2022
8+
ms.date: 01/12/2022
99
ms.author: cshoe
1010
---
1111

@@ -141,6 +141,7 @@ To complete the integration with Front Door, you need to update the application
141141
- Restrict traffic to your site only through Front Door
142142
- Restrict traffic to your site only from your Front Door instance
143143
- Define which domains can access your site
144+
- Disable caching for secured routes
144145

145146
Open the [staticwebapp.config.json](configuration.md) file for your site and make the following changes.
146147

@@ -171,6 +172,18 @@ Open the [staticwebapp.config.json](configuration.md) file for your site and mak
171172

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

175+
1. For all secured routes in your app, disable Azure Front Door caching by adding `"Cache-Control": "no-store"` to the route definition.
176+
177+
```json
178+
{
179+
"route": "/members",
180+
"allowedRoles": ["authenticated, members"],
181+
"headers": {
182+
"Cache-Control": "no-store"
183+
}
184+
}
185+
```
186+
174187
With this configuration, your site is no longer available via the generated `*.azurestaticapps.net` hostname, but exclusively through the hostnames configured in your Front Door instance.
175188

176189
## Considerations

0 commit comments

Comments
 (0)