Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 36 additions & 35 deletions .github/workflows/browser-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
test-suite: '--mode=standard --profile=httpCache --suite=symfonycache'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-symfony-cache'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish6:
name: "Varnish 6 integration tests"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
Expand All @@ -28,11 +24,7 @@ jobs:
setup: "doc/docker/base-dev.yml:doc/docker/varnish.yml:doc/docker/selenium.yml"
test-suite: '--mode=standard --profile=httpCache --suite=varnish6'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish7:
name: "Varnish 7 integration tests"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
Expand All @@ -41,11 +33,7 @@ jobs:
setup: "doc/docker/base-dev.yml:doc/docker/varnish7.yml:doc/docker/selenium.yml"
test-suite: '--mode=standard --profile=httpCache --suite=varnish7'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish6-translation-aware:
name: "Varnish integration tests (translation-aware)"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
Expand All @@ -55,11 +43,7 @@ jobs:
test-suite: '--mode=standard --profile=httpCache --suite=varnish6-translation-aware'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-translation-aware'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish7-translation-aware:
name: "Varnish 7 integration tests (translation-aware)"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
Expand All @@ -69,11 +53,7 @@ jobs:
test-suite: '--mode=standard --profile=httpCache --suite=varnish7-translation-aware'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-translation-aware'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish6-token:
name: "Varnish 6 integration tests with invalidate token"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
Expand All @@ -83,11 +63,7 @@ jobs:
test-suite: '--mode=standard --profile=httpCache --suite=varnish6'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-token'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish7-token:
name: "Varnish 7 integration tests with invalidate token"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
Expand All @@ -97,8 +73,33 @@ jobs:
test-suite: '--mode=standard --profile=httpCache --suite=varnish7'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-token'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
secrets: inherit
varnish9:
name: "Varnish 9 integration tests"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
with:
project-edition: 'oss'
setup: "doc/docker/base-dev.yml:doc/docker/varnish9.yml:doc/docker/selenium.yml"
test-suite: '--mode=standard --profile=httpCache --suite=varnish9'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup'
secrets: inherit
varnish9-translation-aware:
name: "Varnish 9 integration tests (translation-aware)"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
with:
project-edition: 'oss'
setup: "doc/docker/base-dev.yml:doc/docker/varnish9.yml:doc/docker/selenium.yml"
test-suite: '--mode=standard --profile=httpCache --suite=varnish9-translation-aware'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-translation-aware'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets: inherit
varnish9-token:
name: "Varnish 9 integration tests with invalidate token"
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
with:
project-edition: 'oss'
setup: "doc/docker/base-dev.yml:doc/docker/varnish9.yml:doc/docker/selenium.yml"
test-suite: '--mode=standard --profile=httpCache --suite=varnish9'
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-token'
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
secrets: inherit
32 changes: 31 additions & 1 deletion behat_suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,37 @@ httpCache:
paths:
- '%paths.base%/vendor/ibexa/http-cache/features/varnish'
filters:
tags: '@varnish7&&~@translationNotAware'
tags: '@varnish7&&~@translationNotAware'
contexts:
- Ibexa\Behat\API\Context\TestContext
- Ibexa\Behat\API\Context\ContentTypeContext
- Ibexa\Behat\Core\Context\TimeContext
- Ibexa\Behat\Core\Context\ConfigurationContext
- Ibexa\Behat\API\Context\ContentContext
- Ibexa\Behat\Browser\Context\BrowserContext
- Ibexa\Behat\Browser\Context\AuthenticationContext
- Behat\MinkExtension\Context\MinkContext
- Ibexa\Behat\Browser\Context\ContentPreviewContext
varnish9:
paths:
- '%paths.base%/vendor/ibexa/http-cache/features/varnish'
filters:
tags: '@varnish9&&~@translationAware'
contexts:
- Ibexa\Behat\API\Context\TestContext
- Ibexa\Behat\API\Context\ContentTypeContext
- Ibexa\Behat\Core\Context\TimeContext
- Ibexa\Behat\Core\Context\ConfigurationContext
- Ibexa\Behat\API\Context\ContentContext
- Ibexa\Behat\Browser\Context\BrowserContext
- Ibexa\Behat\Browser\Context\AuthenticationContext
- Behat\MinkExtension\Context\MinkContext
- Ibexa\Behat\Browser\Context\ContentPreviewContext
varnish9-translation-aware:
paths:
- '%paths.base%/vendor/ibexa/http-cache/features/varnish'
filters:
tags: '@varnish9&&~@translationNotAware'
contexts:
- Ibexa\Behat\API\Context\TestContext
- Ibexa\Behat\API\Context\ContentTypeContext
Expand Down
9 changes: 8 additions & 1 deletion docs/varnish/vcl/varnish7.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ sub vcl_recv {
}
}

// Logged-in users must not be served stale content while the backend is healthy: drop their
// grace allowance so an expired object is refetched rather than delivered from the grace
// window. varnish5/6.vcl do this in vcl_hit with return (miss), which later versions do not support.
if (req.http.cookie && std.healthy(req.backend_hint)) {
set req.grace = 0s;
}

// Do a standard lookup on assets (these don't vary by user context hash)
// Note that file extension list below is not extensive, so consider completing it to fit your needs.
if (req.url ~ "\.(css|js|gif|jpe?g|bmp|png|tiff?|ico|img|tga|wmf|svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv|zip|gz|pdf|ttf|eot|wof)$") {
Expand Down Expand Up @@ -93,7 +100,7 @@ sub vcl_backend_response {
set beresp.do_esi = true;
}

// Make Varnish keep all objects for up to 1 hour beyond their TTL, see vcl_hit for Request logic on this
// Make Varnish keep all objects for up to 1 hour beyond their TTL, see vcl_recv for Request logic on this
// This will make Varnish to refresh objects in cache after 1 hour
// The total time object can be in cache is 70 minutes (grace + keep time)
set beresp.grace = 1h;
Expand Down
Loading
Loading