Is this usable for my entire site?

Created on 5 September 2025, 29 days ago

Problem/Motivation

My problem is Drupal behind a proxy and I need the vary header to properly set the language.
http-response set-header Vary "Accept-Language, Cookie, Accept-Encoding".
How can I use your code to make that possible?
Thank you?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇹Austria maxilein

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @maxilein
  • 🇨🇭Switzerland Elendev

    I would add a custom CacheContext extending the VaryCacheContextInterface, and provide all the wanted Vary headers through the `getVaryHeaders` method.

    If you need Drupal to handle variation, you can also compute all those headers in the `getContext` method.

    I would do a custom CacheContext per Vary header though.

    You could try to "decorate" the existing CacheContexts (like language, cookie, and so on) and provide a "VaryCacheContextInterface" decorator.

    You need to create a custom module in any case.

    I hope this helps

Production build 0.71.5 2024