Description: The cache key includes input, key, and options (minus non-serializable signal/bypassCache). Large inputs/keys create huge JSON strings and increase memory usage. Also, using raw plaintext as part of the key can be inefficient.
Files: lib/hooks/useCipherWorker.ts
Proposed enhancement: Use a hashing strategy (e.g., stable hash of input+key+options) for the cache key instead of full JSON.stringify of large strings. Keep the LRU cache but store hashed keys and cap total memory usage.
Description: The cache key includes input, key, and options (minus non-serializable signal/bypassCache). Large inputs/keys create huge JSON strings and increase memory usage. Also, using raw plaintext as part of the key can be inefficient.
Files: lib/hooks/useCipherWorker.ts
Proposed enhancement: Use a hashing strategy (e.g., stable hash of input+key+options) for the cache key instead of full JSON.stringify of large strings. Keep the LRU cache but store hashed keys and cap total memory usage.