Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 6, 2024
1 parent 3eab995 commit aa4261b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/cache/memory-cache-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class MemoryStoreReadableStream extends Readable {
* @type {MemoryStoreValue}
*/
#value

/**
* @type {Buffer[]}
*/
Expand Down
9 changes: 2 additions & 7 deletions lib/handler/cache-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,9 @@ class CacheHandler extends DecoratorHandler {
statusCode >= 200 &&
statusCode <= 399
) {
// https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons
// Try/catch for if it's synchronous
// https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-response
try {
const result = this.#store.deleteByOrigin(this.#requestOptions.origin)
if (typeof result?.catch === 'function') {
// Fail silently
result.catch(noop)
}
this.#store.deleteByOrigin(this.#requestOptions.origin.toString())?.catch?.(noop)
} catch {
// Fail silently
}
Expand Down

0 comments on commit aa4261b

Please sign in to comment.