On enabling useOutputCache it is rendering only a single site on multidomain, multilanguage setup

I have a multidomain, multilanguage setup, http://english.local for English language and http://french.local for French language.

When I enabled useOutputCache in VSF local.json, it show only either English site or French site on each domain.

Please guide me, how to configure this to show the right site on right domain.


I believe that for both domains you have same cacheKey.
Please open: core/scripts/server.ts. There you have part like:

const site = req.headers['x-vs-store-code'] || 'main'
const cacheKey = `page:${site}:${req.url}`

Probably, req.url is always the same for both domains - so the app does not see difference between french.local and english.local. Maybe it would be worth to add some header inside Nginx reverse proxy - that would tell app where is the difference. Then add support to it like that:

const site = req.headers['x-vs-store-code'] || req.headers['x-your-custom-header-from-nginx'] || 'main'
1 Like

Thanks @Fifciuu, it realy help me.