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
By default, we drop all incoming request headers from being passed to the cached event handler. This is to ensure cache is not leaked and users get the same response.
However, a valid usecase might be actually intentionally supporting multiple cached responses based on headers (language, variant, multi domain, etc). We might support an opt-in feature varies: [host, x-domain] that creates cache segments for each variant and using hashed values to map.
This feature would be very helpful, our nuxt app is deployed on different domains with different locales and we would like to use routeRules for caching.
I would like to help to implement it. Do i just have to extend the getKey method? Should i also add the headers which are defined in varies to the request? Is there something else to consider?
Context: #1023 (reply in thread)
By default, we drop all incoming request headers from being passed to the cached event handler. This is to ensure cache is not leaked and users get the same response.
However, a valid usecase might be actually intentionally supporting multiple cached responses based on headers (language, variant, multi domain, etc). We might support an opt-in feature
varies: [host, x-domain]
that creates cache segments for each variant and using hashed values to map.Related/Similar spec to inspire: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary
The text was updated successfully, but these errors were encountered: