Skip to content

perf(document): _sigCache signature data-URL cache is unbounded #119

Description

@jdmanring

Problem (audit D3)

static/js/document.js _sigCache = new Map() stores signature data_urls (base64, ~33% larger than binary) and is never bounded or evicted — it only grows. emailLibrary._libListCache already uses an LRU cap (_LIB_CACHE_MAX); _sigCache should too.

Bounded by the number of signatures (usually small), so low impact — but an unbounded cache is the wrong default.

Fix

Add a max size + evict-oldest on insert, mirroring _libListCache. Affected: static/js/document.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-candidateBug or feature suitable for contributing to upstream

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions