File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import * as types from './types'
66import { includeNotionIdInUrls } from './config'
77import { getCanonicalPageId } from './get-canonical-page-id'
88import { notion } from './notion-api'
9+ import ExpiryMap from 'expiry-map'
910
1011const uuid = ! ! includeNotionIdInUrls
12+ const cache = new ExpiryMap ( 10000 )
1113
1214export async function getSiteMap ( ) : Promise < types . SiteMap > {
1315 const partialSiteMap = await getAllPages (
@@ -22,7 +24,8 @@ export async function getSiteMap(): Promise<types.SiteMap> {
2224}
2325
2426const getAllPages = pMemoize ( getAllPagesImpl , {
25- cacheKey : ( ...args ) => JSON . stringify ( args )
27+ cacheKey : ( ...args ) => JSON . stringify ( args ) ,
28+ cache
2629} )
2730
2831async function getAllPagesImpl (
You can’t perform that action at this time.
0 commit comments