Skip to content

IBX-12244: Restored refresh-instead-of-stale for logged-in users on Varnish 7 - #86

Merged
alongosz merged 1 commit into
4.6from
IBX-12244-varnish7-vcl-hit
Oct 8, 2026
Merged

alongosz merged 1 commit into
4.6from
IBX-12244-varnish7-vcl-hit

Conversation

@vidarl

@vidarl vidarl commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12244

Caution

This PR Depends on #85 so base branch is set to IBX-12241-varnish-cache-behat. However, do not merge into IBX-12241-varnish-cache-behat. Instead it should be merged into 46 once #85 has been merged there.

Related PRs:

Description:

varnish5.vcl and varnish6.vcl calls return (miss) from vcl_hit to prevent logged-in users
from receiving stale content. Calling return (miss) from vcl_hit is not supported in varnish7
and later. And the functionality was never ported to the varnish7 vcl.
This caps the grace period per request in vcl_recv instead, right after cookie normalisation so
only surviving session cookies count:

if (req.http.cookie && std.healthy(req.backend_hint)) {
    set req.grace = 0s;
}

For QA:

FYI : Due to #85, there is now a behat test for this specific case:

Scenario: A logged-in user in the grace window gets a refreshed response, not a stale one

Documentation:

@sonarqubecloud

Copy link
Copy Markdown

Comment thread docs/varnish/vcl/varnish7.vcl Resolved
@vidarl
vidarl force-pushed the IBX-12244-varnish7-vcl-hit branch 2 times, most recently from 3618f1c to f5f939e Compare October 6, 2026 09:03
Base automatically changed from IBX-12241-varnish-cache-behat to 4.6 October 8, 2026 10:10
@alongosz
alongosz force-pushed the IBX-12244-varnish7-vcl-hit branch from f5f939e to 1dc1e09 Compare October 8, 2026 19:54
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@alongosz
alongosz added this pull request to stack #103 October 8, 2026 20:01
@alongosz
alongosz merged commit 3bd0b41 into 4.6 Oct 8, 2026
26 checks passed
@alongosz
alongosz deleted the IBX-12244-varnish7-vcl-hit branch October 8, 2026 21:50
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.

5 participants