Skip to content

Add bypass_cache and cache_tags support - #85

Merged
11bit merged 2 commits into
mainfrom
add-bypass-cache-and-cache-tags
Aug 20, 2026
Merged

Add bypass_cache and cache_tags support#85
11bit merged 2 commits into
mainfrom
add-bypass-cache-and-cache-tags

Conversation

@11bit

@11bit 11bit commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #84 (comment)

Aligns the library with the imgproxy docs update, which added two new URL options (both imgproxy Pro):

Option Short Value Format
bypass_cache bc boolean (1/t/true) bc:%bypass
cache_tags ct list of strings ct:%tag1:%tag2:...:%tagN

Both are documented in processing.mdx and getting_info.mdx, so they live in optionsShared/typesShared and are wired into both generateUrl and generateImageInfoUrl.

Implementation notes

  • bypass_cache follows the enforceThumbnail pattern: test uses "key" in options, so an explicit false still emits bc:f rather than being dropped.
  • cache_tags follows the preset pattern: guardIsNotArray plus a non-string-item check, joined with :.

Not included

The config-side half of the docs diff (IMGPROXY_ALLOW_BYPASS_CACHE, the IMGPROXY_MAX_ML_CONCURRENCYIMGPROXY_ML_NUM_STREAMS rename, and the new ML tuning vars) is server configuration, which this package doesn't model.

Verification

  • tsc --noEmit clean, eslint src tests clean
  • vitest run → 99 files / 1115 tests passing (20 new)
  • End-to-end spot check: generateUrl(..., { width: 10, bypass_cache: true, cache_tags: ["a","b"] })/bc:t/ct:a:b/w:10/plain/img; generateImageInfoUrl(..., { bc: false, ct: ["x"] })/bc:f/ct:x/plain/img

🤖 Generated with Claude Code

https://claude.ai/code/session_01G8Aa3xeVUCaxKtQJDzZhMo

11bit and others added 2 commits August 20, 2026 17:15
Adds the `bypass_cache` (`bc`) and `cache_tags` (`ct`) options introduced
in the imgproxy docs. Both are documented for processing and image info
URLs, so they live in optionsShared/typesShared and are wired into both
generators.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8Aa3xeVUCaxKtQJDzZhMo
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8Aa3xeVUCaxKtQJDzZhMo
@11bit
11bit merged commit 020080d into main Aug 20, 2026
1 check passed
@11bit
11bit deleted the add-bypass-cache-and-cache-tags branch August 20, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage docs of imgproxy have been updated

1 participant