Add bypass_cache and cache_tags support - #85
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #84 (comment)
Aligns the library with the imgproxy docs update, which added two new URL options (both imgproxy Pro):
bypass_cachebc1/t/true)bc:%bypasscache_tagsctct:%tag1:%tag2:...:%tagNBoth are documented in
processing.mdxandgetting_info.mdx, so they live inoptionsShared/typesSharedand are wired into bothgenerateUrlandgenerateImageInfoUrl.Implementation notes
bypass_cachefollows theenforceThumbnailpattern:testuses"key" in options, so an explicitfalsestill emitsbc:frather than being dropped.cache_tagsfollows thepresetpattern:guardIsNotArrayplus a non-string-item check, joined with:.Not included
The config-side half of the docs diff (
IMGPROXY_ALLOW_BYPASS_CACHE, theIMGPROXY_MAX_ML_CONCURRENCY→IMGPROXY_ML_NUM_STREAMSrename, and the new ML tuning vars) is server configuration, which this package doesn't model.Verification
tsc --noEmitclean,eslint src testscleanvitest run→ 99 files / 1115 tests passing (20 new)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