1
0
mirror of https://github.com/quay/quay.git synced 2026-01-27 18:42:52 +03:00
Files
Li Zhang bd587488c8 fix(proxy): serve cached images without upstream check (PROJQUAY-8440)
This fix resolves an issue where cached images required upstream
registry availability to be pulled, defeating the purpose of the
proxy cache feature.

Problem:
- The _update_manifest_for_tag() method always contacted the upstream
  registry via manifest_exists() HTTP HEAD request
- When upstream registry was unavailable, pulls failed with 504 timeout
- This occurred even when the manifest and blobs were fully cached

Solution:
- Add early return that serves from cache when:
  1. Tag is not expired (still within TTL)
  2. Manifest is not a placeholder (has full content)
- Only contact upstream when tag expired or manifest incomplete
- Reduces upstream traffic and improves availability

Benefits:
- Cached images work when upstream unavailable
- Reduced upstream registry traffic
- Lower latency for cached pulls
- True proxy cache behavior (cache-first)

Fixes: https://issues.redhat.com/browse/PROJQUAY-8440

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 16:13:50 +08:00
..
2019-11-12 11:09:47 -05:00