Skip to content

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

Open
mnocon wants to merge 1 commit into4.6from
user-context-hash
Open

IBX-11331: Fixed X-User-Context-Hash usage#3064
mnocon wants to merge 1 commit into4.6from
user-context-hash

Conversation

@mnocon
Copy link
Contributor

@mnocon mnocon commented Feb 13, 2026

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

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
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
@sonarqubecloud
Copy link

@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`).
Copy link
Contributor

@dabrt dabrt Feb 26, 2026

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"?


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`).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Users with the same user-context-hash here the same cache (as long as [[= product_name =]] responds with `Vary: X-User-Context-Hash`).
Users with the same user-context-hash share the same cache (as long as [[= product_name =]] responds with `Vary: X-User-Context-Hash`).

That's how I'd write it based on my knowledge, @vidarl please confirm 😉

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