Why not cache it for the user, but go ahead and retrieve it in the background?
If it's not cached, then it has to be fetched synchronously for anything depending on its value to work - so it's slow.
If it is cached, then the cached value is known.
If the JS triggers another download, and the browser requests the second resource before the initial JS is done downloading...