Skip to content

Conversation

@nichtsam
Copy link
Contributor

@nichtsam nichtsam commented Oct 2, 2025

Currently, requests to /assets/* that don’t match an existing asset fall through to the Remix handler.
I think we can assume that these requests are always for assets and never for pages, so it’s safe to respond with 404 directly.

This avoids unnecessary page routing and can significantly reduce overhead in rare cases.
For example, when opening DevTools on a production site, the browser automatically requests all sourcemap files, which don’t exist in production. Without this change, each of these requests triggers the root loader, including all authentication logic and database access.

Test Plan

Checklist

  • Tests updated
  • Docs updated

Screenshots

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@kentcdodds kentcdodds merged commit 0921caa into epicweb-dev:main Oct 2, 2025
6 checks passed
@nichtsam nichtsam deleted the prevent-assets-fallthrough branch October 2, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants