Skip to content

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

Description

@Chucks1093

Summary

Creator list and detail responses are cached, but the cache key must be stable regardless of the order query params appear in the URL. A shared helper that normalizes and hashes the param set into a deterministic cache key should replace any inline key construction.

Scope

  • Add buildCacheKey(base: string, params: Record<string, unknown>): string helper
  • Sorts param keys alphabetically before hashing so order does not matter
  • Returns a fixed-length string suitable for use as a cache key
  • Add unit tests confirming identical params in different order produce the same key and different params produce different keys

Acceptance Criteria

  • Same params in different order produce identical cache key
  • Different params produce different cache keys
  • Output is a fixed-length string

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions