Forem Creators and Builders 🌱

Discussion on: What internationalization features should we support?

Collapse
 
alex profile image
Alex Smith

added the browser preference header as a variant in all cache keys

@ben that will be a stretch at the moment. We can do that with Fastly, Nginx won't have the same functionality set up to do that approach yet (using keys, vary headers to lookup tags/keys in cache, etc.). Nginx only has the power to handle paths. Are you suggesting we wait until we get there with Nginx? That would be a future cycle to get Nginx to that level.

If not, it's easier with regards to caching, to not mess with vary and cache keys. By using just the subfolder approach, /es/, Nginx/Lua can re-write a request at the edge based on settings (cookie or headers). This approach also avoids having to do a separate implementation for Fastly.

I'll have to look more into service workers and our setup. Won't doing something like this change that whole approach since the shell content would be dynamic with i18n? The content could change anytime based on settings and not just on deploys. Don't we bust that service worker cache on deploys by Heroku slug?