rusackas commented on PR #39357:
URL: https://github.com/apache/superset/pull/39357#issuecomment-4887654257

   Rebased (merged current master) to clear the conflict... master moved the 
language pack endpoint to `/language_pack/<lang>/`, so the async-fetch fallback 
here now uses the new URL. Translator, preamble, and bootstrap view tests all 
pass locally.
   
   I also dug into the payload question since inlining the pack isn't free. 
Measured with the French catalog: ~237KB of Jed JSON, which is ~67KB gzipped 
inside the HTML. That cost only applies to non-English locales (en injects 
null, so default deployments pay nothing), and only on full page loads, which 
are rare in an SPA. On a cold cache this is actually *faster* than master: the 
fetch approach serializes HTML → JS bundle → language pack round trip before 
first render, and the inline pack removes that whole hop. On warm loads it's 
~67KB of extra HTML where the fetch would have been free from browser cache.
   
   One more point in its favor: `send_file` serves the pack with our 1-year 
`SEND_FILE_MAX_AGE_DEFAULT` on an unversioned URL, so today's cached packs can 
go stale for a year after an upgrade... the inline pack always matches the 
server version. If we ever want the best of both worlds, a versioned static 
pack loaded via a synchronous script tag before the entry bundle would be 
cacheable AND race-free, but that's a build-pipeline project, not this PR.
   
   LGTM once CI comes back green. 🤞


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to