Skip to content

Align public middleware example with maxAge configuration#3149

Merged
pwizla merged 2 commits into
strapi:mainfrom
singhvishalkr:docs-2324-public-middleware
May 13, 2026
Merged

Align public middleware example with maxAge configuration#3149
pwizla merged 2 commits into
strapi:mainfrom
singhvishalkr:docs-2324-public-middleware

Conversation

@singhvishalkr
Copy link
Copy Markdown
Contributor

Closes #2324.

The option table for \strapi::public\ only documents \maxAge, but the sample block used \defer\ and \index, which does not match what Strapi 5 pulls from this middleware \config\ (see \packages/core/core/src/middlewares/public.ts). I updated both JavaScript and TypeScript examples to set \maxAge\ only and added a short note that the key stays camelCase and lines up with how the core forwards the value to \koa-static.

Made with Cursor

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment May 13, 2026 10:00am

Request Review

@pwizla pwizla self-assigned this May 13, 2026
@pwizla pwizla added this to the 6.25.0 milestone May 13, 2026
@pwizla pwizla added pr: chore source: CMS contribution PRs that are part of the Documentation Contribution Program labels May 13, 2026
Comment thread docusaurus/docs/cms/configurations/middlewares.md Outdated
@pwizla pwizla merged commit 29cf09b into strapi:main May 13, 2026
3 of 4 checks passed
pwizla added a commit that referenced this pull request May 13, 2026
)

* Align public middleware docs example with maxAge option

* Apply suggestion from @pwizla

---------

Co-authored-by: Vishal Kumar Singh <vishal.kr.singh2021@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution PRs that are part of the Documentation Contribution Program pr: chore source: CMS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: middleware strapi::public strange example

2 participants