Skip to content

Commit b5b8f3d

Browse files
committed
build: use small uri
1 parent 16e83b4 commit b5b8f3d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ module.exports = ({
6161

6262
return async ({ req, res, ...opts }) => {
6363
const hasForce = Boolean(req.query ? req.query.force : parse(req.url.split('?')[1]).force)
64-
const url = urlResolve('http://localhost', req.url)
65-
const key = getKey(url)
64+
65+
// Because req.url is relative, we need to convert it into an absolute url
66+
// `u:req.url` is the smallest url length possible
67+
const key = getKey(urlResolve('u:', req.url))
6668

6769
const cachedData = await cache.get(key)
6870
const hasData = cachedData !== undefined

0 commit comments

Comments
 (0)