You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Developers need to send a Vary header on Accept-Language
Accept Language has lots of variations (language, script, region, subtags...)
This solution could lead to multiply each cache entry (example.com has many urls) by an order of thousand (all accept-language variations), leading to cache exclusions (LRU), thus tons of cache misses on edge servers. This would hurt performance a lot.
/.well-known/accept-language
es fr en en-US en-GB pt pt-BR zh zh-Hant
When user goes to example.com, the static page /.well-known/accept-language is queryied in parallel, and cached accordingly.
While the page is loading, the Browser checks /.well-known/accept-language fast response and determines if there is a better language for the user among those proposed by example.com
If so, Browser stops navigation and send Accept-Language: es
Browser receives es content and displays it.
On further navigations,
If the cache of the /.well-known/accept-language is valid, Browser queries this local cached file, select the best language and send Accept-Language: es
If the cache of the /.well-known/accept-language file is expired, Browser goes to step 1)
Uh oh!
There was an error while loading. Please reload this page.
Problem
Given
This solution could lead to multiply each cache entry (example.com has many urls) by an order of thousand (all accept-language variations), leading to cache exclusions (LRU), thus tons of cache misses on edge servers. This would hurt performance a lot.
References on Vary and locales:
Solution
Expose accepted languages on a well-known url
/.well-known/accept-language
is queryied in parallel, and cached accordingly./.well-known/accept-language
fast response and determines if there is a better language for the user among those proposed by example.com/.well-known/accept-language
is valid, Browser queries this local cached file, select the best language and send Accept-Language: es/.well-known/accept-language
file is expired, Browser goes to step 1)References on well-known urls:
Other possibilities:
The text was updated successfully, but these errors were encountered: