Skip to content

Commit

Permalink
Replace tiny-lru with toad-cache (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad committed Jan 14, 2024
1 parent 59a0e8b commit 30f5e53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const fp = require('fastify-plugin')
const { lru } = require('tiny-lru')
const { LruMap } = require('toad-cache')
const querystring = require('fast-querystring')
const fastContentTypeParse = require('fast-content-type-parse')
const Stream = require('node:stream')
Expand Down Expand Up @@ -32,7 +32,7 @@ const fastifyReplyFrom = fp(function from (fastify, opts, next) {
const retryMethods = new Set(opts.retryMethods || [
'GET', 'HEAD', 'OPTIONS', 'TRACE'])

const cache = opts.disableCache ? undefined : lru(opts.cacheURLs || 100)
const cache = opts.disableCache ? undefined : new LruMap(opts.cacheURLs || 100)
const base = opts.base
const requestBuilt = buildRequest({
http: opts.http,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"fast-querystring": "^1.0.0",
"fastify-plugin": "^4.0.0",
"pump": "^3.0.0",
"tiny-lru": "^11.0.0",
"toad-cache": "^3.7.0",
"undici": "^5.19.1"
},
"pre-commit": [
Expand Down

0 comments on commit 30f5e53

Please sign in to comment.