Use Response Helpers for Resource Routes
Use remix-utils/responses to return typed resource responses.
Pattern
import { html, javascript, stylesheet, xml, txt, notModified } from "remix-utils/responses";
export async function loader() {
if (shouldUseCache) return notModified();
return html("<h1>Hello</h1>");
}Rules
- Use helpers to set proper content types
- Return
notModified()for 304 cache hits