Open FreekVR opened 1 year ago
Interesting, I didn't expect people to modify stuff other than the headers on the fly but that's a good way to do localization actually.
I will think of something, I think the cache plugin could recalculate the key itself.
We're building a multilingual site, and every query is getting a default variable with the current language site like so;
This is causing a problem however with the
cache
plugin from thedefaultPlugins
list, as the cache key is getting set before the plugins run (?) at any rate, when the language changes, it uses cached data for a different set of query variables now.I re-generate the key after setting the variables in the plugin above now, which feels like a bit of a workaround
operation.key = getQueryKey(operation);
This successfully fixed the caching issue for me.
I would suggest the key would get (re)calculated in the dedup/cache plugins when they run?