[Web] Avoid redundant OPFS lookup on cache hit#19791
Conversation
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request optimizes the ArtifactOPFSCache by attempting to read from the cache first before performing an OPFS lookup on a cache hit. It also refactors readFromCache to return undefined on a cache miss instead of throwing an error, delegating the error handling to the caller. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
cc @akaashrp |
|
Thanks for the ping. Been a bit busy, will try to take a look either today or tomorrow. |
|
Thanks! |
Why
fetchWithCacheranaddToCache(which callsstore.has()) thenreadFromCache, doing two OPFS lookups on a cache hit.How
store.has()addToCachethen read only on a miss