Creates a handler that ATTEMPTS to serve a file from a directory, resolving
the request path relative to createPublicFileHandler.options.assetsDir.
The plugin passes the CLIENT-BUILD ROOT here (the parent of the assets dir,
where Vite copies public/) — probing the assets subdir itself missed every
public file.
Returns the served HandlerResult on a hit — including the
400 answer for an undecodable request path — and undefined on a miss so
the caller can fall through to the next handler (the SSR catch-all).
Successful responses carry Cache-Control: public, max-age=0, must-revalidate: root files are not content-hashed, so an immutable year
would serve stale content the browser refuses to re-check.
Creates a handler that ATTEMPTS to serve a file from a directory, resolving the request path relative to createPublicFileHandler.options.assetsDir. The plugin passes the CLIENT-BUILD ROOT here (the parent of the assets dir, where Vite copies
public/) — probing the assets subdir itself missed every public file.Returns the served
HandlerResulton a hit — including the400answer for an undecodable request path — andundefinedon a miss so the caller can fall through to the next handler (the SSR catch-all).Successful responses carry
Cache-Control: public, max-age=0, must-revalidate: root files are not content-hashed, so animmutableyear would serve stale content the browser refuses to re-check.