e0b92471

By: Michael Lynch <git@mtlynch.io>

Load the request user once per request into context

requireOwner, the owner middleware, and uploadPost each loaded the same
user from the store independently, so an authenticated upload request hit
ReadUserByID up to three times. Introduce a resolveUser middleware that
loads the user once and caches it on the request context; currentUser and
newPageData now read from that cache. Every authenticated page request now
does a single user read.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Suite timing

Time to Start Worker time Duration Time to finish
Config 1s 4s 4s 5s
Eval 6s 1m08s 1m08s 1m14s
Build 10s 4m46s 3m06s 3m17s
Test - - - -
Deploy - - - -
Suite 1s 5m59s 3m15s 3m17s

Timeline

0s10s20s30s40s50s1m1m10s1m20s1m30s1m40s