Avoid hitting the database on every cross-origin request by caching published custom domain checks for five minutes.
Only allow registered custom domain origins on public GET/OPTIONS status page API routes instead of the entire application API surface.