Skip to content

feat: add buildCacheKey helper for deterministic cache keys (#577)#595

Merged
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
Killerjunior:feature/issue-577-cache-key-helper
Jul 23, 2026
Merged

feat: add buildCacheKey helper for deterministic cache keys (#577)#595
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
Killerjunior:feature/issue-577-cache-key-helper

Conversation

@Killerjunior

Copy link
Copy Markdown
Contributor

Summary

Closes #577

  • Implemented buildCacheKey(base: string, params: Record<string, unknown>): string helper in cache-key-params.utils.ts to generate deterministic, fixed-length cache keys from a base string and query param set.
  • Ensured param keys are sorted lexicographically prior to SHA-256 hashing so query parameter order does not affect the output cache key.
  • Added comprehensive unit tests in cache-key-params.utils.test.ts verifying identical keys for reordered params, different keys for distinct params, and fixed-length formatting.

Testing

  • pnpm lint
  • pnpm build
  • pnpm exec prisma generate when schema or generated types changed

Checklist

@Chucks1093
Chucks1093 merged commit 9958467 into accesslayerorg:main Jul 23, 2026
1 check passed
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.

Add helper for generating a stable cache key from a creator ID and query param set

2 participants