From 920eef6c1de59c4c7124a88059628b74ddf71988 Mon Sep 17 00:00:00 2001 From: Nick K Date: Tue, 9 Sep 2025 16:30:20 -0700 Subject: [PATCH 1/2] docs: add additional behaviors for layout stability in CloudFront configuration --- advanced/subpath/route53-cloudfront.mdx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/advanced/subpath/route53-cloudfront.mdx b/advanced/subpath/route53-cloudfront.mdx index ed35c3718..9b2e7d774 100644 --- a/advanced/subpath/route53-cloudfront.mdx +++ b/advanced/subpath/route53-cloudfront.mdx @@ -158,6 +158,29 @@ Lastly, we're going to edit the `Default (*)` behavior. 2. Select **Save changes**. +### Additional behaviors for layout stability + +To prevent layout shifts and ensure smooth navigation, add these additional behaviors for static asset handling: + +#### `/mintlify-assets/_next/static/*` + +Create a behavior with a **Path pattern** of `/mintlify-assets/_next/static/*` to serve static assets efficiently: + +- Set **Origin and origin groups** to your `.mintlify.dev` URL +- Set **Cache policy** to **CachingOptimized** +- Set **Origin request policy** to **AllViewerExceptHostHeader** + +This behavior should be ordered **above** the default behavior in your behaviors list, as CloudFront evaluates them in order. + +#### Update default behavior for app router navigation + +For your **Default (*)** behavior, ensure these settings to handle HTML and app router navigation properly: + +- Set **Cache policy** to **CachingDisabled** (since RSC ?_rsc= payloads vary and shouldn't be cached) +- Set **Origin request policy** to **AllViewerExceptHostHeader** + +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. + ### Check behaviors are set up correctly 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 Your documentation is now live at `/docs` for your primary domain. - + \ No newline at end of file From d636ccb37467d019ea869431e7a1fc5fd263ae20 Mon Sep 17 00:00:00 2001 From: Nick K Date: Wed, 10 Sep 2025 20:03:55 -0700 Subject: [PATCH 2/2] feat: update search CI action --- .github/workflows/update-search.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/update-search.yml diff --git a/.github/workflows/update-search.yml b/.github/workflows/update-search.yml new file mode 100644 index 000000000..522768ba3 --- /dev/null +++ b/.github/workflows/update-search.yml @@ -0,0 +1,32 @@ +name: Update Mintlify Search + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +on: + push + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Install Mintlify Search Adapter + run: npm install -g @mintlify/search-ingest + + - name: Update Mintlify Chunks + env: + MINTLIFY_API_HOST: ${{ secrets.MINTLIFY_API_HOST }} + MINTLIFY_API_KEY: ${{ secrets.MINTLIFY_API_KEY }} + MINTLIFY_ORGANIZATION_ID: ${{ secrets.MINTLIFY_ORGANIZATION_ID }} + MINTLIFY_DATASET_ID: ${{ secrets.MINTLIFY_DATASET_ID }} + NODE_OPTIONS: --max-old-space-size=8192 + run: "mintlify-search-ingest --path . -r https://cursor.com/docs"