Use static domain for assets

From #6233.
Can we make sure os_files_static_domain is set here? otherwise just return false