Skip to content

IBX-11331: Fixed X-User-Context-Hash usage - #3064

Merged
mnocon merged 2 commits into
4.6from
user-context-hash
Mar 2, 2026
Merged

IBX-11331: Fixed X-User-Context-Hash usage#3064
mnocon merged 2 commits into
4.6from
user-context-hash

Conversation

@mnocon

@mnocon mnocon commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

IBX-11331

Target: 4.6, 5.0, 3.3

Note: I've adjusted the casing in some lines (see comments) to make it match our VCLs.

@github-actions

Copy link
Copy Markdown

if (req.restarts == 0
&& (req.http.accept ~ "application/vnd.fos.user-context-hash"
|| req.http.X-Context-User-Hash
|| req.http.x-user-context-hash

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I've adjusted it to be in line with https://github.com/ibexa/http-cache/blob/4.6/docs/varnish/vcl/varnish7.vcl (which uses lowercase here)

@mnocon
mnocon marked this pull request as ready for review February 13, 2026 15:40
@mnocon
mnocon requested a review from vidarl February 13, 2026 15:40
@mnocon
mnocon requested a review from a team February 26, 2026 11:52
@ibexa-workflow-automation-1
ibexa-workflow-automation-1 Bot requested review from adriendupuis, dabrt and julitafalcondusza and removed request for a team February 26, 2026 11:53

As explained in [User Context Hash caching](context_aware_cache.md#user-context-hash-caching), the HTTP cache indexes the cache based on the user-context-hash.
Users with the same user-context-hash here the same cache (as long as [[= product_name =]] responds with `Vary: X-Context-User-Hash`).
Users with the same user-context-hash here the same cache (as long as [[= product_name =]] responds with `Vary: X-User-Context-Hash`).

@dabrt dabrt Feb 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vidarl Please help me understand the sentence - it seems off, like the verb is missing. Is it... "users... here USE the same cache"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here => share

Comment thread docs/infrastructure_and_maintenance/cache/http_cache/content_aware_cache.md Outdated
@sonarqubecloud

Copy link
Copy Markdown

@mnocon
mnocon merged commit 4e6d42f into 4.6 Mar 2, 2026
9 checks passed
@mnocon
mnocon deleted the user-context-hash branch March 2, 2026 10:55
mnocon added a commit that referenced this pull request Mar 2, 2026
* IBX-11331: Fixed X-User-Context-Hash usage

* Apply suggestions from code review
mnocon added a commit that referenced this pull request Mar 2, 2026
* IBX-11331: Fixed X-User-Context-Hash usage

* Apply suggestions from code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants