Skip to content

Tests: add coverage for upstream cache Age handling#42

Open
anchmelev wants to merge 2 commits into
nginx:masterfrom
anchmelev:issue-1234-upstream-cache-age-tests
Open

Tests: add coverage for upstream cache Age handling#42
anchmelev wants to merge 2 commits into
nginx:masterfrom
anchmelev:issue-1234-upstream-cache-age-tests

Conversation

@anchmelev
Copy link
Copy Markdown

@anchmelev anchmelev commented Apr 2, 2026

Proposed changes

Add proxy cache tests for Age header handling.

This PR adds tests covering:

  • cache freshness reduction when upstream responses include Age
  • handling when Age arrives before or after Cache-Control
  • behavior with proxy_ignore_headers Age
  • $upstream_cache_age on cached and non-cached responses
  • revalidation behavior
  • Perl compatibility fixes for the test expressions

This PR is a companion to nginx/nginx#1234.

Validated with:

  • TEST_NGINX_BINARY=/Users/chmelev.andrey/dev/open-source/nginx/objs/nginx prove -v ./proxy_cache_age.t

Checklist

mdounin added 2 commits April 14, 2026 05:40
The test used regular expressions with "{,n}" quantifier with empty
lower bound, which is only available starting with Perl 5.34.0.  Further,
it used variable-length look-behind assertions, which are only available
starting with Perl 5.30.0 and emit experimental warning till Perl 5.36.0.

Fix is to rewrite regular expressions in question using "(?>pattern)"
instead (an independent subexpression), which is available since at least
Perl 5.005.
@anchmelev anchmelev force-pushed the issue-1234-upstream-cache-age-tests branch from 0ea3975 to 89f4dc3 Compare April 14, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: External Pull Requests

Development

Successfully merging this pull request may close these issues.

3 participants