Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache-Control header from layout routes not applied to child routes #6445

Closed
1 task done
andrelandgraf opened this issue May 21, 2023 · 1 comment
Closed
1 task done

Comments

@andrelandgraf
Copy link
Contributor

andrelandgraf commented May 21, 2023

What version of Remix are you using?

Was able to reproduce in 1.7.2, 1.13.0 and 1.16.1

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. Add a "Cache-Control" header to a headers export in any layout route (root.tsx, __layout.tsx, dashboard.tsx)
// /dash.tsx layout route
export function headers() {
    return {
      "X-Cool": "Dash",
      "X-Dash": "Dash",
      "Cache-Control": "private, no-cache",
    }
  }
  1. Open a nested route in a browser window
  2. Inspect the Network tab
  3. Notice that all but the "Cache-Control' headers of the layout route are applied

Expected Behavior

"Cache-Control" header is applied to every child route.

Actual Behavior

"Cache-Control" header is not applied, even if child routes do not add any headers. Custom headers are taken over in the child route (e.g., /dash/child) but not the "Cache-Control" header.

@andrelandgraf
Copy link
Contributor Author

Logan and Ryan mentioned in Discord that this is a known issue and is actively being worked on: #6431

Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant