You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advanced/subpath/route53-cloudfront.mdx
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,29 @@ Lastly, we're going to edit the `Default (*)` behavior.
158
158
159
159
2. Select **Save changes**.
160
160
161
+
### Additional behaviors for layout stability
162
+
163
+
To prevent layout shifts and ensure smooth navigation, add these additional behaviors for static asset handling:
164
+
165
+
#### `/mintlify-assets/_next/static/*`
166
+
167
+
Create a behavior with a **Path pattern** of `/mintlify-assets/_next/static/*` to serve static assets efficiently:
168
+
169
+
- Set **Origin and origin groups** to your `.mintlify.dev` URL
170
+
- Set **Cache policy** to **CachingOptimized**
171
+
- Set **Origin request policy** to **AllViewerExceptHostHeader**
172
+
173
+
This behavior should be ordered **above** the default behavior in your behaviors list, as CloudFront evaluates them in order.
174
+
175
+
#### Update default behavior for app router navigation
176
+
177
+
For your **Default (*)** behavior, ensure these settings to handle HTML and app router navigation properly:
178
+
179
+
- Set **Cache policy** to **CachingDisabled** (since RSC ?_rsc= payloads vary and shouldn't be cached)
180
+
- Set **Origin request policy** to **AllViewerExceptHostHeader**
181
+
182
+
These configurations prevent the sidenav from snapping up and down during navigation by ensuring only the new page's MDX content is fetched while keeping layout assets stable.
183
+
161
184
### Check behaviors are set up correctly
162
185
163
186
If you follow the above steps, your behaviors should look like this:
@@ -208,4 +231,4 @@ Now, we're going to bring the functionality of the CloudFront distribution into
208
231
209
232
Your documentation is now live at `/docs` for your primary domain.
0 commit comments