The Cache Storage API exhibited O(n) performance degradation as cache size grew, taking ~0.79ms per cache.match() call with 15k entries. This was caused by three separate bottlenecks: 1. URL string comparisons in SQL WHERE clause (not indexed) 2. Expensive LEFT JOIN + GROUP BY + COUNT() operations 3. Missing index on response_headers(entry_id, name) This patch: - Simplifies the SQL query to use hash-only WHERE clause with post-query URL verification - Removes unnecessary JOIN/GROUP BY, checks vary headers separately when needed - Adds composite index on response_headers(entry_id, name) - Bumps schema version to 30 with migration Performance improvement: 8x faster (0.79ms → 0.10ms per query with 15k entries) Test case: https://ylngxt.csb.app/ r?asuth Differential Revision: https://phabricator.services.mozilla.com/D278397