[{"data":1,"prerenderedAt":2172},["ShallowReactive",2],{"navigation":3,"-guide-cache":225,"-guide-cache-surround":2167},[4,76,219],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Docs","/guide","1.guide/0.index",[9,11,16,21,26,31,36,41,46,51,56,61,66,71],{"title":5,"path":6,"stem":7,"icon":10},"ph:book-open-duotone",{"title":12,"path":13,"stem":14,"icon":15},"Server Utils","/guide/utils","1.guide/1.utils","ri:tools-line",{"title":17,"path":18,"stem":19,"icon":20},"Tasks","/guide/tasks","1.guide/10.tasks","codicon:run-all",{"title":22,"path":23,"stem":24,"icon":25},"Server Routes","/guide/routing","1.guide/2.routing","ri:direction-line",{"title":27,"path":28,"stem":29,"icon":30},"WebSocket","/guide/websocket","1.guide/3.websocket","cib:socket-io",{"title":32,"path":33,"stem":34,"icon":35},"KV Storage","/guide/storage","1.guide/4.storage","carbon:datastore",{"title":37,"path":38,"stem":39,"icon":40},"SQL Database","/guide/database","1.guide/5.database","ri:database-2-line",{"title":42,"path":43,"stem":44,"icon":45},"Cache","/guide/cache","1.guide/6.cache","ri:speed-line",{"title":47,"path":48,"stem":49,"icon":50},"Fetch","/guide/fetch","1.guide/7.fetch","ri:global-line",{"title":52,"path":53,"stem":54,"icon":55},"Assets","/guide/assets","1.guide/8.assets","ri:image-2-line",{"title":57,"path":58,"stem":59,"icon":60},"Plugins","/guide/plugins","1.guide/9.plugins","ri:plug-line",{"title":62,"path":63,"stem":64,"icon":65},"Configuration","/guide/configuration","1.guide/97.configuration","ri:settings-3-line",{"title":67,"path":68,"stem":69,"icon":70},"TypeScript","/guide/typescript","1.guide/98.typescript","tabler:brand-typescript",{"title":72,"path":73,"stem":74,"icon":75},"Nightly Channel","/guide/nightly","1.guide/99.nightly","ri:moon-fill",{"title":77,"path":78,"stem":79,"children":80,"icon":82},"Deploy","/deploy","2.deploy/0.index",[81,83,87,113,118],{"title":77,"path":78,"stem":79,"icon":82},"ri:upload-cloud-2-line",{"title":84,"path":85,"stem":86,"icon":50},"Edge Workers","/deploy/workers","2.deploy/1.workers",{"title":88,"path":89,"stem":90,"children":91,"page":112},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[92,97,102,107],{"title":93,"path":94,"stem":95,"icon":96},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":98,"path":99,"stem":100,"icon":101},"WinterJS","/deploy/runtimes/_winterjs","2.deploy/10.runtimes/_winterjs","game-icons:cold-heart",{"title":103,"path":104,"stem":105,"icon":106},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":108,"path":109,"stem":110,"icon":111},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":114,"path":115,"stem":116,"icon":117},"Custom Preset","/deploy/custom-presets","2.deploy/2.custom-presets","ri:file-code-line",{"title":119,"path":120,"stem":121,"children":122,"page":112},"Providers","/deploy/providers","2.deploy/20.providers",[123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,207,211,215],{"title":124,"path":125,"stem":126},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":128,"path":129,"stem":130},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":132,"path":133,"stem":134},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":136,"path":137,"stem":138},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":140,"path":141,"stem":142},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":144,"path":145,"stem":146},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":148,"path":149,"stem":150},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":152,"path":153,"stem":154},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":156,"path":157,"stem":158},"Edgio","/deploy/providers/edgio","2.deploy/20.providers/edgio",{"title":160,"path":161,"stem":162},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":164,"path":165,"stem":166},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":168,"path":169,"stem":170},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":172,"path":173,"stem":174},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":176,"path":177,"stem":178},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":180,"path":181,"stem":182},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":184,"path":185,"stem":186},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":188,"path":189,"stem":190},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":192,"path":193,"stem":194},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":196,"path":197,"stem":198},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":200,"path":201,"stem":202},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":204,"path":205,"stem":206},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":208,"path":209,"stem":210},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":212,"path":213,"stem":214},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":216,"path":217,"stem":218},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":220,"path":221,"stem":222,"children":223,"icon":65},"Config","/config","3.config/0.index",[224],{"title":220,"path":221,"stem":222,"icon":65},{"id":226,"title":42,"body":227,"description":2161,"extension":2162,"meta":2163,"navigation":2164,"path":43,"seo":2165,"stem":44,"__hash__":2166},"content/1.guide/6.cache.md",{"type":228,"value":229,"toc":2149,"icon":45},"minimark",[230,235,244,262,340,347,357,363,375,379,386,389,632,643,697,702,711,716,723,731,967,970,974,977,984,1079,1091,1271,1275,1282,1304,1315,1427,1433,1539,1542,1551,1698,1702,1711,1759,1762,1839,1842,1865,1868,1899,1903,1929,1932,1948,1951,1966,1969,1979,2045,2052,2058,2088,2095,2145],[231,232,234],"h2",{"id":233},"cached-event-handlers","Cached event handlers",[236,237,238,239,243],"p",{},"To cache an event handler, you simply need to use the ",[240,241,242],"code",{},"defineCachedEventHandler"," method.",[236,245,246,247,256,257,261],{},"It works like ",[248,249,253],"a",{"href":250,"rel":251},"https://v1.h3.dev/guide/event-handler",[252],"nofollow",[240,254,255],{},"defineEventHandler"," but with an additional second  ",[248,258,260],{"href":259},"#options","options"," parameter.",[263,264,270],"pre",{"className":265,"code":266,"filename":267,"language":268,"meta":269,"style":269},"language-ts shiki shiki-themes github-light github-dark github-dark","// Cache an API handler\nexport default defineCachedEventHandler((event) => {\n  // My event handler\n}, { maxAge: 60 * 60 /* 1 hour */ });\n","server/routes/cached.ts","ts","",[240,271,272,281,312,318],{"__ignoreMap":269},[273,274,277],"span",{"class":275,"line":276},"line",1,[273,278,280],{"class":279},"sCsY4","// Cache an API handler\n",[273,282,284,288,291,295,299,303,306,309],{"class":275,"line":283},2,[273,285,287],{"class":286},"so5gQ","export",[273,289,290],{"class":286}," default",[273,292,294],{"class":293},"shcOC"," defineCachedEventHandler",[273,296,298],{"class":297},"slsVL","((",[273,300,302],{"class":301},"sQHwn","event",[273,304,305],{"class":297},") ",[273,307,308],{"class":286},"=>",[273,310,311],{"class":297}," {\n",[273,313,315],{"class":275,"line":314},3,[273,316,317],{"class":279},"  // My event handler\n",[273,319,321,324,328,331,334,337],{"class":275,"line":320},4,[273,322,323],{"class":297},"}, { maxAge: ",[273,325,327],{"class":326},"suiK_","60",[273,329,330],{"class":286}," *",[273,332,333],{"class":326}," 60",[273,335,336],{"class":279}," /* 1 hour */",[273,338,339],{"class":297}," });\n",[236,341,342,343,346],{},"With this example, the response will be cached for 1 hour and a stale value will be sent to the client while the cache is being updated in the background. If you want to immediately return the updated response set ",[240,344,345],{},"swr: false",".",[348,349,350],"important",{},[236,351,352,353,356],{},"All incoming request headers are dropped when handling cached responses. If you define the ",[240,354,355],{},"varies"," option, only the specified headers will be considered when caching and serving the responses.",[236,358,359,360,362],{},"See the ",[248,361,260],{"href":259}," section for more details about the available options.",[364,365,366],"note",{},[236,367,368,369,372,373,346],{},"You can also use the ",[240,370,371],{},"cachedEventHandler"," method as alias of ",[240,374,242],{},[231,376,378],{"id":377},"cached-functions","Cached functions",[236,380,381,382,385],{},"You can also cache a function using the ",[240,383,384],{},"defineCachedFunction"," function. This is useful for caching the result of a function that is not an event handler, but is part of one, and reusing it in multiple handlers.",[236,387,388],{},"For example, you might want to cache the result of an API call for one hour:",[390,391,392,547],"code-group",{},[263,393,396],{"className":265,"code":394,"filename":395,"language":268,"meta":269,"style":269},"export const cachedGHStars = defineCachedFunction(async (repo: string) => {\n  const data: any = await $fetch(`https://api.github.com/repos/${repo}`)\n\n  return data.stargazers_count\n}, {\n  maxAge: 60 * 60,\n  name: 'ghStars',\n  getKey: (repo: string) => repo\n})\n","server/utils/github.ts",[240,397,398,438,473,479,487,493,508,519,541],{"__ignoreMap":269},[273,399,400,402,405,408,411,414,417,420,423,426,429,432,434,436],{"class":275,"line":276},[273,401,287],{"class":286},[273,403,404],{"class":286}," const",[273,406,407],{"class":326}," cachedGHStars",[273,409,410],{"class":286}," =",[273,412,413],{"class":293}," defineCachedFunction",[273,415,416],{"class":297},"(",[273,418,419],{"class":286},"async",[273,421,422],{"class":297}," (",[273,424,425],{"class":301},"repo",[273,427,428],{"class":286},":",[273,430,431],{"class":326}," string",[273,433,305],{"class":297},[273,435,308],{"class":286},[273,437,311],{"class":297},[273,439,440,443,446,448,451,453,456,459,461,465,467,470],{"class":275,"line":283},[273,441,442],{"class":286},"  const",[273,444,445],{"class":326}," data",[273,447,428],{"class":286},[273,449,450],{"class":326}," any",[273,452,410],{"class":286},[273,454,455],{"class":286}," await",[273,457,458],{"class":293}," $fetch",[273,460,416],{"class":297},[273,462,464],{"class":463},"sfrk1","`https://api.github.com/repos/${",[273,466,425],{"class":297},[273,468,469],{"class":463},"}`",[273,471,472],{"class":297},")\n",[273,474,475],{"class":275,"line":314},[273,476,478],{"emptyLinePlaceholder":477},true,"\n",[273,480,481,484],{"class":275,"line":320},[273,482,483],{"class":286},"  return",[273,485,486],{"class":297}," data.stargazers_count\n",[273,488,490],{"class":275,"line":489},5,[273,491,492],{"class":297},"}, {\n",[273,494,496,499,501,503,505],{"class":275,"line":495},6,[273,497,498],{"class":297},"  maxAge: ",[273,500,327],{"class":326},[273,502,330],{"class":286},[273,504,333],{"class":326},[273,506,507],{"class":297},",\n",[273,509,511,514,517],{"class":275,"line":510},7,[273,512,513],{"class":297},"  name: ",[273,515,516],{"class":463},"'ghStars'",[273,518,507],{"class":297},[273,520,522,525,528,530,532,534,536,538],{"class":275,"line":521},8,[273,523,524],{"class":293},"  getKey",[273,526,527],{"class":297},": (",[273,529,425],{"class":301},[273,531,428],{"class":286},[273,533,431],{"class":326},[273,535,305],{"class":297},[273,537,308],{"class":286},[273,539,540],{"class":297}," repo\n",[273,542,544],{"class":275,"line":543},9,[273,545,546],{"class":297},"})\n",[263,548,551],{"className":265,"code":549,"filename":550,"language":268,"meta":269,"style":269},"export default defineEventHandler(async (event) => {\n  const repo = event.context.params.repo\n  const stars = await cachedGHStars(repo).catch(() => 0)\n\n  return { repo, stars }\n})\n","server/api/stars/[...repo].ts",[240,552,553,576,588,617,621,628],{"__ignoreMap":269},[273,554,555,557,559,562,564,566,568,570,572,574],{"class":275,"line":276},[273,556,287],{"class":286},[273,558,290],{"class":286},[273,560,561],{"class":293}," defineEventHandler",[273,563,416],{"class":297},[273,565,419],{"class":286},[273,567,422],{"class":297},[273,569,302],{"class":301},[273,571,305],{"class":297},[273,573,308],{"class":286},[273,575,311],{"class":297},[273,577,578,580,583,585],{"class":275,"line":283},[273,579,442],{"class":286},[273,581,582],{"class":326}," repo",[273,584,410],{"class":286},[273,586,587],{"class":297}," event.context.params.repo\n",[273,589,590,592,595,597,599,601,604,607,610,612,615],{"class":275,"line":314},[273,591,442],{"class":286},[273,593,594],{"class":326}," stars",[273,596,410],{"class":286},[273,598,455],{"class":286},[273,600,407],{"class":293},[273,602,603],{"class":297},"(repo).",[273,605,606],{"class":293},"catch",[273,608,609],{"class":297},"(() ",[273,611,308],{"class":286},[273,613,614],{"class":326}," 0",[273,616,472],{"class":297},[273,618,619],{"class":275,"line":320},[273,620,478],{"emptyLinePlaceholder":477},[273,622,623,625],{"class":275,"line":489},[273,624,483],{"class":286},[273,626,627],{"class":297}," { repo, stars }\n",[273,629,630],{"class":275,"line":495},[273,631,546],{"class":297},[236,633,634,635,638,639,642],{},"The stars will be cached in development inside ",[240,636,637],{},".nitro/cache/functions/ghStars/\u003Cowner>/\u003Crepo>.json"," with ",[240,640,641],{},"value"," being the number of stars.",[263,644,648],{"className":645,"code":646,"language":647,"meta":269,"style":269},"language-json shiki shiki-themes github-light github-dark github-dark","{\"expires\":1677851092249,\"value\":43991,\"mtime\":1677847492540,\"integrity\":\"ZUHcsxCWEH\"}\n","json",[240,649,650],{"__ignoreMap":269},[273,651,652,655,658,660,663,666,669,671,674,676,679,681,684,686,689,691,694],{"class":275,"line":276},[273,653,654],{"class":297},"{",[273,656,657],{"class":326},"\"expires\"",[273,659,428],{"class":297},[273,661,662],{"class":326},"1677851092249",[273,664,665],{"class":297},",",[273,667,668],{"class":326},"\"value\"",[273,670,428],{"class":297},[273,672,673],{"class":326},"43991",[273,675,665],{"class":297},[273,677,678],{"class":326},"\"mtime\"",[273,680,428],{"class":297},[273,682,683],{"class":326},"1677847492540",[273,685,665],{"class":297},[273,687,688],{"class":326},"\"integrity\"",[273,690,428],{"class":297},[273,692,693],{"class":463},"\"ZUHcsxCWEH\"",[273,695,696],{"class":297},"}\n",[348,698,699],{},[236,700,701],{},"Because the cached data is serialized to JSON, it is important that the cached function does not return anything that cannot be serialized, such as Symbols, Maps, Sets…",[364,703,704],{},[236,705,368,706,372,709,346],{},[240,707,708],{},"cachedFunction",[240,710,384],{},[712,713,715],"h3",{"id":714},"edge-workers","Edge workers",[236,717,718,719,722],{},"In edge workers, the instance is destroyed after each request. Nitro automatically uses ",[240,720,721],{},"event.waitUntil"," to keep the instance alive while the cache is being updated while the response is sent to the client.",[236,724,725,726,728,729,346],{},"To ensure that your cached functions work as expected in edge workers, you should always pass the ",[240,727,302],{}," as the first argument to the function using ",[240,730,384],{},[390,732,733,891],{},[263,734,736],{"className":265,"code":735,"filename":395,"language":268,"meta":269,"style":269},"import type { H3Event } from 'h3'\n\nexport const cachedGHStars = defineCachedFunction(async (event: H3Event, repo: string) => {\n  const data: any = await $fetch(`https://api.github.com/repos/${repo}`)\n\n  return data.stargazers_count\n}, {\n  maxAge: 60 * 60,\n  name: 'ghStars',\n  getKey: (event: H3Event, repo: string) => repo\n})\n",[240,737,738,755,759,799,825,829,835,839,851,859,886],{"__ignoreMap":269},[273,739,740,743,746,749,752],{"class":275,"line":276},[273,741,742],{"class":286},"import",[273,744,745],{"class":286}," type",[273,747,748],{"class":297}," { H3Event } ",[273,750,751],{"class":286},"from",[273,753,754],{"class":463}," 'h3'\n",[273,756,757],{"class":275,"line":283},[273,758,478],{"emptyLinePlaceholder":477},[273,760,761,763,765,767,769,771,773,775,777,779,781,784,787,789,791,793,795,797],{"class":275,"line":314},[273,762,287],{"class":286},[273,764,404],{"class":286},[273,766,407],{"class":326},[273,768,410],{"class":286},[273,770,413],{"class":293},[273,772,416],{"class":297},[273,774,419],{"class":286},[273,776,422],{"class":297},[273,778,302],{"class":301},[273,780,428],{"class":286},[273,782,783],{"class":293}," H3Event",[273,785,786],{"class":297},", ",[273,788,425],{"class":301},[273,790,428],{"class":286},[273,792,431],{"class":326},[273,794,305],{"class":297},[273,796,308],{"class":286},[273,798,311],{"class":297},[273,800,801,803,805,807,809,811,813,815,817,819,821,823],{"class":275,"line":320},[273,802,442],{"class":286},[273,804,445],{"class":326},[273,806,428],{"class":286},[273,808,450],{"class":326},[273,810,410],{"class":286},[273,812,455],{"class":286},[273,814,458],{"class":293},[273,816,416],{"class":297},[273,818,464],{"class":463},[273,820,425],{"class":297},[273,822,469],{"class":463},[273,824,472],{"class":297},[273,826,827],{"class":275,"line":489},[273,828,478],{"emptyLinePlaceholder":477},[273,830,831,833],{"class":275,"line":495},[273,832,483],{"class":286},[273,834,486],{"class":297},[273,836,837],{"class":275,"line":510},[273,838,492],{"class":297},[273,840,841,843,845,847,849],{"class":275,"line":521},[273,842,498],{"class":297},[273,844,327],{"class":326},[273,846,330],{"class":286},[273,848,333],{"class":326},[273,850,507],{"class":297},[273,852,853,855,857],{"class":275,"line":543},[273,854,513],{"class":297},[273,856,516],{"class":463},[273,858,507],{"class":297},[273,860,862,864,866,868,870,872,874,876,878,880,882,884],{"class":275,"line":861},10,[273,863,524],{"class":293},[273,865,527],{"class":297},[273,867,302],{"class":301},[273,869,428],{"class":286},[273,871,783],{"class":293},[273,873,786],{"class":297},[273,875,425],{"class":301},[273,877,428],{"class":286},[273,879,431],{"class":326},[273,881,305],{"class":297},[273,883,308],{"class":286},[273,885,540],{"class":297},[273,887,889],{"class":275,"line":888},11,[273,890,546],{"class":297},[263,892,894],{"className":265,"code":893,"filename":550,"language":268,"meta":269,"style":269},"export default defineEventHandler(async (event) => {\n  const repo = event.context.params.repo\n  const stars = await cachedGHStars(event, repo).catch(() => 0)\n\n  return { repo, stars }\n})\n",[240,895,896,918,928,953,957,963],{"__ignoreMap":269},[273,897,898,900,902,904,906,908,910,912,914,916],{"class":275,"line":276},[273,899,287],{"class":286},[273,901,290],{"class":286},[273,903,561],{"class":293},[273,905,416],{"class":297},[273,907,419],{"class":286},[273,909,422],{"class":297},[273,911,302],{"class":301},[273,913,305],{"class":297},[273,915,308],{"class":286},[273,917,311],{"class":297},[273,919,920,922,924,926],{"class":275,"line":283},[273,921,442],{"class":286},[273,923,582],{"class":326},[273,925,410],{"class":286},[273,927,587],{"class":297},[273,929,930,932,934,936,938,940,943,945,947,949,951],{"class":275,"line":314},[273,931,442],{"class":286},[273,933,594],{"class":326},[273,935,410],{"class":286},[273,937,455],{"class":286},[273,939,407],{"class":293},[273,941,942],{"class":297},"(event, repo).",[273,944,606],{"class":293},[273,946,609],{"class":297},[273,948,308],{"class":286},[273,950,614],{"class":326},[273,952,472],{"class":297},[273,954,955],{"class":275,"line":320},[273,956,478],{"emptyLinePlaceholder":477},[273,958,959,961],{"class":275,"line":489},[273,960,483],{"class":286},[273,962,627],{"class":297},[273,964,965],{"class":275,"line":495},[273,966,546],{"class":297},[236,968,969],{},"This way, the function will be able to keep the instance alive while the cache is being updated without slowing down the response to the client.",[231,971,973],{"id":972},"caching-route-rules","Caching route rules",[236,975,976],{},"This feature enables you to add caching routes based on a glob pattern directly in the main configuration file. This is especially useful to have a global cache strategy for a part of your application.",[236,978,979,980,983],{},"Cache all the blog routes for 1 hour with ",[240,981,982],{},"stale-while-revalidate"," behavior:",[390,985,986,1036],{},[263,987,990],{"className":265,"code":988,"filename":989,"language":268,"meta":269,"style":269},"export default defineNitroConfig({\n  routeRules: {\n    \"/blog/**\": { cache: { maxAge: 60 * 60 } },\n  },\n});\n","nitro.config.ts",[240,991,992,1004,1009,1026,1031],{"__ignoreMap":269},[273,993,994,996,998,1001],{"class":275,"line":276},[273,995,287],{"class":286},[273,997,290],{"class":286},[273,999,1000],{"class":293}," defineNitroConfig",[273,1002,1003],{"class":297},"({\n",[273,1005,1006],{"class":275,"line":283},[273,1007,1008],{"class":297},"  routeRules: {\n",[273,1010,1011,1014,1017,1019,1021,1023],{"class":275,"line":314},[273,1012,1013],{"class":463},"    \"/blog/**\"",[273,1015,1016],{"class":297},": { cache: { maxAge: ",[273,1018,327],{"class":326},[273,1020,330],{"class":286},[273,1022,333],{"class":326},[273,1024,1025],{"class":297}," } },\n",[273,1027,1028],{"class":275,"line":320},[273,1029,1030],{"class":297},"  },\n",[273,1032,1033],{"class":275,"line":489},[273,1034,1035],{"class":297},"});\n",[263,1037,1040],{"className":265,"code":1038,"filename":1039,"language":268,"meta":269,"style":269},"export default defineNuxtConfig({\n  routeRules: {\n    \"/blog/**\": { cache: { maxAge: 60 * 60 } },\n  },\n});\n","nuxt.config.ts",[240,1041,1042,1053,1057,1071,1075],{"__ignoreMap":269},[273,1043,1044,1046,1048,1051],{"class":275,"line":276},[273,1045,287],{"class":286},[273,1047,290],{"class":286},[273,1049,1050],{"class":293}," defineNuxtConfig",[273,1052,1003],{"class":297},[273,1054,1055],{"class":275,"line":283},[273,1056,1008],{"class":297},[273,1058,1059,1061,1063,1065,1067,1069],{"class":275,"line":314},[273,1060,1013],{"class":463},[273,1062,1016],{"class":297},[273,1064,327],{"class":326},[273,1066,330],{"class":286},[273,1068,333],{"class":326},[273,1070,1025],{"class":297},[273,1072,1073],{"class":275,"line":320},[273,1074,1030],{"class":297},[273,1076,1077],{"class":275,"line":489},[273,1078,1035],{"class":297},[236,1080,1081,1082,1086,1087,1090],{},"If we want to use a ",[248,1083,1085],{"href":1084},"#customize-cache-storage","custom storage"," mount point, we can use the ",[240,1088,1089],{},"base"," option.",[390,1092,1093,1178],{},[263,1094,1096],{"className":265,"code":1095,"filename":989,"language":268,"meta":269,"style":269},"export default defineNitroConfig({\n  storage: {\n    redis: {\n      driver: \"redis\",\n      url: \"redis://localhost:6379\",\n    },\n  },\n  routeRules: {\n    \"/blog/**\": { cache: { maxAge: 60 * 60, base: \"redis\" } },\n  },\n});\n",[240,1097,1098,1108,1113,1118,1128,1138,1143,1147,1151,1170,1174],{"__ignoreMap":269},[273,1099,1100,1102,1104,1106],{"class":275,"line":276},[273,1101,287],{"class":286},[273,1103,290],{"class":286},[273,1105,1000],{"class":293},[273,1107,1003],{"class":297},[273,1109,1110],{"class":275,"line":283},[273,1111,1112],{"class":297},"  storage: {\n",[273,1114,1115],{"class":275,"line":314},[273,1116,1117],{"class":297},"    redis: {\n",[273,1119,1120,1123,1126],{"class":275,"line":320},[273,1121,1122],{"class":297},"      driver: ",[273,1124,1125],{"class":463},"\"redis\"",[273,1127,507],{"class":297},[273,1129,1130,1133,1136],{"class":275,"line":489},[273,1131,1132],{"class":297},"      url: ",[273,1134,1135],{"class":463},"\"redis://localhost:6379\"",[273,1137,507],{"class":297},[273,1139,1140],{"class":275,"line":495},[273,1141,1142],{"class":297},"    },\n",[273,1144,1145],{"class":275,"line":510},[273,1146,1030],{"class":297},[273,1148,1149],{"class":275,"line":521},[273,1150,1008],{"class":297},[273,1152,1153,1155,1157,1159,1161,1163,1166,1168],{"class":275,"line":543},[273,1154,1013],{"class":463},[273,1156,1016],{"class":297},[273,1158,327],{"class":326},[273,1160,330],{"class":286},[273,1162,333],{"class":326},[273,1164,1165],{"class":297},", base: ",[273,1167,1125],{"class":463},[273,1169,1025],{"class":297},[273,1171,1172],{"class":275,"line":861},[273,1173,1030],{"class":297},[273,1175,1176],{"class":275,"line":888},[273,1177,1035],{"class":297},[263,1179,1181],{"className":265,"code":1180,"filename":1039,"language":268,"meta":269,"style":269},"export default defineNuxtConfig({\n  nitro: {\n    storage: {\n      redis: {\n        driver: \"redis\",\n        url: \"redis://localhost:6379\",\n      },\n    },\n  },\n  routeRules: {\n    \"/blog/**\": { cache: { maxAge: 60 * 60, base: \"redis\" } },\n  },\n});\n",[240,1182,1183,1193,1198,1203,1208,1217,1226,1231,1235,1239,1243,1261,1266],{"__ignoreMap":269},[273,1184,1185,1187,1189,1191],{"class":275,"line":276},[273,1186,287],{"class":286},[273,1188,290],{"class":286},[273,1190,1050],{"class":293},[273,1192,1003],{"class":297},[273,1194,1195],{"class":275,"line":283},[273,1196,1197],{"class":297},"  nitro: {\n",[273,1199,1200],{"class":275,"line":314},[273,1201,1202],{"class":297},"    storage: {\n",[273,1204,1205],{"class":275,"line":320},[273,1206,1207],{"class":297},"      redis: {\n",[273,1209,1210,1213,1215],{"class":275,"line":489},[273,1211,1212],{"class":297},"        driver: ",[273,1214,1125],{"class":463},[273,1216,507],{"class":297},[273,1218,1219,1222,1224],{"class":275,"line":495},[273,1220,1221],{"class":297},"        url: ",[273,1223,1135],{"class":463},[273,1225,507],{"class":297},[273,1227,1228],{"class":275,"line":510},[273,1229,1230],{"class":297},"      },\n",[273,1232,1233],{"class":275,"line":521},[273,1234,1142],{"class":297},[273,1236,1237],{"class":275,"line":543},[273,1238,1030],{"class":297},[273,1240,1241],{"class":275,"line":861},[273,1242,1008],{"class":297},[273,1244,1245,1247,1249,1251,1253,1255,1257,1259],{"class":275,"line":888},[273,1246,1013],{"class":463},[273,1248,1016],{"class":297},[273,1250,327],{"class":326},[273,1252,330],{"class":286},[273,1254,333],{"class":326},[273,1256,1165],{"class":297},[273,1258,1125],{"class":463},[273,1260,1025],{"class":297},[273,1262,1264],{"class":275,"line":1263},12,[273,1265,1030],{"class":297},[273,1267,1269],{"class":275,"line":1268},13,[273,1270,1035],{"class":297},[231,1272,1274],{"id":1273},"customize-cache-storage","Customize cache storage",[236,1276,1277,1278,1281],{},"Nitro stores the data in the ",[240,1279,1280],{},"cache:"," mount point.",[1283,1284,1285,1295],"ul",{},[1286,1287,1288,1289,1294],"li",{},"In production, it will use the ",[248,1290,1293],{"href":1291,"rel":1292},"https://unstorage.unjs.io/drivers/memory",[252],"memory driver"," by default.",[1286,1296,1297,1298,1303],{},"In development, it will use the ",[248,1299,1302],{"href":1300,"rel":1301},"https://unstorage.unjs.io/drivers/fs",[252],"filesystem driver",", writing to a temporary dir.",[236,1305,1306,1307,1310,1311,1314],{},"To overwrite the production storage, set the ",[240,1308,1309],{},"cache"," mount point using the ",[240,1312,1313],{},"storage"," option:",[390,1316,1317,1369],{},[263,1318,1320],{"className":265,"code":1319,"filename":989,"language":268,"meta":269,"style":269},"export default defineNitroConfig({\n  storage: {\n    cache: {\n      driver: 'redis',\n      /* redis connector options */\n    }\n  }\n})\n",[240,1321,1322,1332,1336,1341,1350,1355,1360,1365],{"__ignoreMap":269},[273,1323,1324,1326,1328,1330],{"class":275,"line":276},[273,1325,287],{"class":286},[273,1327,290],{"class":286},[273,1329,1000],{"class":293},[273,1331,1003],{"class":297},[273,1333,1334],{"class":275,"line":283},[273,1335,1112],{"class":297},[273,1337,1338],{"class":275,"line":314},[273,1339,1340],{"class":297},"    cache: {\n",[273,1342,1343,1345,1348],{"class":275,"line":320},[273,1344,1122],{"class":297},[273,1346,1347],{"class":463},"'redis'",[273,1349,507],{"class":297},[273,1351,1352],{"class":275,"line":489},[273,1353,1354],{"class":279},"      /* redis connector options */\n",[273,1356,1357],{"class":275,"line":495},[273,1358,1359],{"class":297},"    }\n",[273,1361,1362],{"class":275,"line":510},[273,1363,1364],{"class":297},"  }\n",[273,1366,1367],{"class":275,"line":521},[273,1368,546],{"class":297},[263,1370,1372],{"className":265,"code":1371,"filename":1039,"language":268,"meta":269,"style":269},"export default defineNuxtConfig({\n  nitro: {\n    storage: {\n      cache: {\n        driver: 'redis',\n        /* redis connector options */\n      }\n    }\n  }\n})\n",[240,1373,1374,1384,1388,1392,1397,1405,1410,1415,1419,1423],{"__ignoreMap":269},[273,1375,1376,1378,1380,1382],{"class":275,"line":276},[273,1377,287],{"class":286},[273,1379,290],{"class":286},[273,1381,1050],{"class":293},[273,1383,1003],{"class":297},[273,1385,1386],{"class":275,"line":283},[273,1387,1197],{"class":297},[273,1389,1390],{"class":275,"line":314},[273,1391,1202],{"class":297},[273,1393,1394],{"class":275,"line":320},[273,1395,1396],{"class":297},"      cache: {\n",[273,1398,1399,1401,1403],{"class":275,"line":489},[273,1400,1212],{"class":297},[273,1402,1347],{"class":463},[273,1404,507],{"class":297},[273,1406,1407],{"class":275,"line":495},[273,1408,1409],{"class":279},"        /* redis connector options */\n",[273,1411,1412],{"class":275,"line":510},[273,1413,1414],{"class":297},"      }\n",[273,1416,1417],{"class":275,"line":521},[273,1418,1359],{"class":297},[273,1420,1421],{"class":275,"line":543},[273,1422,1364],{"class":297},[273,1424,1425],{"class":275,"line":861},[273,1426,546],{"class":297},[236,1428,1429,1430,1314],{},"In development, you can also overwrite the cache mount point using the ",[240,1431,1432],{},"devStorage",[390,1434,1435,1483],{},[263,1436,1438],{"className":265,"code":1437,"filename":989,"language":268,"meta":269,"style":269},"export default defineNitroConfig({\n  devStorage: {\n    cache: {\n      driver: 'redis',\n      /* redis connector options */\n    }\n  }\n})\n",[240,1439,1440,1450,1455,1459,1467,1471,1475,1479],{"__ignoreMap":269},[273,1441,1442,1444,1446,1448],{"class":275,"line":276},[273,1443,287],{"class":286},[273,1445,290],{"class":286},[273,1447,1000],{"class":293},[273,1449,1003],{"class":297},[273,1451,1452],{"class":275,"line":283},[273,1453,1454],{"class":297},"  devStorage: {\n",[273,1456,1457],{"class":275,"line":314},[273,1458,1340],{"class":297},[273,1460,1461,1463,1465],{"class":275,"line":320},[273,1462,1122],{"class":297},[273,1464,1347],{"class":463},[273,1466,507],{"class":297},[273,1468,1469],{"class":275,"line":489},[273,1470,1354],{"class":279},[273,1472,1473],{"class":275,"line":495},[273,1474,1359],{"class":297},[273,1476,1477],{"class":275,"line":510},[273,1478,1364],{"class":297},[273,1480,1481],{"class":275,"line":521},[273,1482,546],{"class":297},[263,1484,1486],{"className":265,"code":1485,"filename":1039,"language":268,"meta":269,"style":269},"export default defineNuxtConfig({\n  nitro: {\n    devStorage: {\n      cache: {\n        driver: 'redis',\n        /* redis connector options */\n      }\n    }\n  }\n})\n",[240,1487,1488,1498,1502,1507,1511,1519,1523,1527,1531,1535],{"__ignoreMap":269},[273,1489,1490,1492,1494,1496],{"class":275,"line":276},[273,1491,287],{"class":286},[273,1493,290],{"class":286},[273,1495,1050],{"class":293},[273,1497,1003],{"class":297},[273,1499,1500],{"class":275,"line":283},[273,1501,1197],{"class":297},[273,1503,1504],{"class":275,"line":314},[273,1505,1506],{"class":297},"    devStorage: {\n",[273,1508,1509],{"class":275,"line":320},[273,1510,1396],{"class":297},[273,1512,1513,1515,1517],{"class":275,"line":489},[273,1514,1212],{"class":297},[273,1516,1347],{"class":463},[273,1518,507],{"class":297},[273,1520,1521],{"class":275,"line":495},[273,1522,1409],{"class":279},[273,1524,1525],{"class":275,"line":510},[273,1526,1414],{"class":297},[273,1528,1529],{"class":275,"line":521},[273,1530,1359],{"class":297},[273,1532,1533],{"class":275,"line":543},[273,1534,1364],{"class":297},[273,1536,1537],{"class":275,"line":861},[273,1538,546],{"class":297},[231,1540,1541],{"id":260},"Options",[236,1543,1544,1545,1547,1548,1550],{},"The ",[240,1546,371],{}," and ",[240,1549,708],{}," functions accept the following options:",[1552,1553,1554,1567,1577,1591,1605,1619,1632,1649,1664,1674,1682],"field-group",{},[1555,1556,1558],"field",{"name":1089,"type":1557},"string",[236,1559,1560,1561,1564,1565,346],{},"Name of the storage mountpoint to use for caching. ",[1562,1563],"br",{},"\nDefault to ",[240,1566,1309],{},[1555,1568,1570],{"name":1569,"type":1557},"name",[236,1571,1572,1573,1576],{},"Guessed from function name if not provided, and falls back to ",[240,1574,1575],{},"'_'"," otherwise.",[1555,1578,1580],{"name":1579,"type":1557},"group",[236,1581,1582,1583,1586,1587,1590],{},"Defaults to ",[240,1584,1585],{},"'nitro/handlers'"," for handlers and ",[240,1588,1589],{},"'nitro/functions'"," for functions.",[1555,1592,1595],{"name":1593,"type":1594},"getKey()","(...args) => string",[236,1596,1597,1598,1601,1602,1604],{},"A function that accepts the same arguments as the original function and returns a cache key (",[240,1599,1600],{},"String","). ",[1562,1603],{},"\nIf not provided, a built-in hash function will be used to generate a key based on the function arguments.",[1555,1606,1608],{"name":1607,"type":1557},"integrity",[236,1609,1610,1611,1613,1614,1618],{},"A value that invalidates the cache when changed. ",[1562,1612],{},"\nBy default, it is computed from ",[1615,1616,1617],"strong",{},"function code",", used in development to invalidate the cache when the function code changes.",[1555,1620,1623],{"name":1621,"type":1622},"maxAge","number",[236,1624,1625,1626,1564,1628,1631],{},"Maximum age that cache is valid, in seconds. ",[1562,1627],{},[240,1629,1630],{},"1"," (second).",[1555,1633,1635],{"name":1634,"type":1622},"staleMaxAge",[236,1636,1637,1638,1641,1642,1644,1645,1648],{},"Maximum age that a stale cache is valid, in seconds. If set to ",[240,1639,1640],{},"-1"," a stale value will still be sent to the client while the cache updates in the background. ",[1562,1643],{},"\nDefaults to ",[240,1646,1647],{},"0"," (disabled).",[1555,1650,1653],{"name":1651,"type":1652},"swr","boolean",[236,1654,1655,1656,1658,1659,1644,1661,346],{},"Enable ",[240,1657,982],{}," behavior to serve a stale cached response while asynchronously revalidating it. ",[1562,1660],{},[240,1662,1663],{},"true",[1555,1665,1668],{"name":1666,"type":1667},"shouldInvalidateCache()","(..args) => boolean",[236,1669,1670,1671,1673],{},"A function that returns a ",[240,1672,1652],{}," to invalidate the current cache and create a new one.",[1555,1675,1677],{"name":1676,"type":1667},"shouldBypassCache()",[236,1678,1670,1679,1681],{},[240,1680,1652],{}," to bypass the current cache without invalidating the existing entry.",[1555,1683,1685],{"name":355,"type":1684},"string[]",[236,1686,1687,1688,1693,1694,1697],{},"An array of request headers to be considered for the cache, ",[248,1689,1692],{"href":1690,"rel":1691},"https://github.com/nitrojs/nitro/issues/1031",[252],"learn more",". If utilizing in a multi-tenant environment, you may want to pass ",[240,1695,1696],{},"['host', 'x-forwarded-host']"," to ensure these headers are not discarded and that the cache is unique per tenant.",[231,1699,1701],{"id":1700},"cache-keys-and-invalidation","Cache keys and invalidation",[236,1703,1704,1705,1707,1708,1710],{},"When using the ",[240,1706,384],{}," or ",[240,1709,242],{}," functions, the cache key is generated using the following pattern:",[263,1712,1714],{"className":265,"code":1713,"language":268,"meta":269,"style":269},"`${options.group}:${options.name}:${options.getKey(...args)}.json`\n",[240,1715,1716],{"__ignoreMap":269},[273,1717,1718,1721,1723,1725,1727,1730,1732,1734,1736,1738,1740,1742,1745,1747,1750,1753,1756],{"class":275,"line":276},[273,1719,1720],{"class":463},"`${",[273,1722,260],{"class":297},[273,1724,346],{"class":463},[273,1726,1579],{"class":297},[273,1728,1729],{"class":463},"}:${",[273,1731,260],{"class":297},[273,1733,346],{"class":463},[273,1735,1569],{"class":297},[273,1737,1729],{"class":463},[273,1739,260],{"class":297},[273,1741,346],{"class":463},[273,1743,1744],{"class":293},"getKey",[273,1746,416],{"class":463},[273,1748,1749],{"class":286},"...",[273,1751,1752],{"class":297},"args",[273,1754,1755],{"class":463},")",[273,1757,1758],{"class":463},"}.json`\n",[236,1760,1761],{},"For example, the following function:",[263,1763,1765],{"className":265,"code":1764,"language":268,"meta":269,"style":269},"const getAccessToken = defineCachedFunction(() => {\n  return String(Date.now())\n}, {\n  maxAge: 10,\n  name: 'getAccessToken',\n  getKey: () => 'default'\n})\n",[240,1766,1767,1785,1801,1805,1814,1823,1835],{"__ignoreMap":269},[273,1768,1769,1772,1775,1777,1779,1781,1783],{"class":275,"line":276},[273,1770,1771],{"class":286},"const",[273,1773,1774],{"class":326}," getAccessToken",[273,1776,410],{"class":286},[273,1778,413],{"class":293},[273,1780,609],{"class":297},[273,1782,308],{"class":286},[273,1784,311],{"class":297},[273,1786,1787,1789,1792,1795,1798],{"class":275,"line":283},[273,1788,483],{"class":286},[273,1790,1791],{"class":293}," String",[273,1793,1794],{"class":297},"(Date.",[273,1796,1797],{"class":293},"now",[273,1799,1800],{"class":297},"())\n",[273,1802,1803],{"class":275,"line":314},[273,1804,492],{"class":297},[273,1806,1807,1809,1812],{"class":275,"line":320},[273,1808,498],{"class":297},[273,1810,1811],{"class":326},"10",[273,1813,507],{"class":297},[273,1815,1816,1818,1821],{"class":275,"line":489},[273,1817,513],{"class":297},[273,1819,1820],{"class":463},"'getAccessToken'",[273,1822,507],{"class":297},[273,1824,1825,1827,1830,1832],{"class":275,"line":495},[273,1826,524],{"class":293},[273,1828,1829],{"class":297},": () ",[273,1831,308],{"class":286},[273,1833,1834],{"class":463}," 'default'\n",[273,1836,1837],{"class":275,"line":510},[273,1838,546],{"class":297},[236,1840,1841],{},"Will generate the following cache key:",[263,1843,1845],{"className":265,"code":1844,"language":268,"meta":269,"style":269},"nitro:functions:getAccessToken:default.json\n",[240,1846,1847],{"__ignoreMap":269},[273,1848,1849,1852,1854,1857,1859,1862],{"class":275,"line":276},[273,1850,1851],{"class":293},"nitro",[273,1853,428],{"class":297},[273,1855,1856],{"class":293},"functions",[273,1858,428],{"class":297},[273,1860,1861],{"class":293},"getAccessToken",[273,1863,1864],{"class":297},":default.json\n",[236,1866,1867],{},"You can invalidate the cached function entry with:",[263,1869,1871],{"className":265,"code":1870,"language":268,"meta":269,"style":269},"await useStorage('cache').removeItem('nitro:functions:getAccessToken:default.json')\n",[240,1872,1873],{"__ignoreMap":269},[273,1874,1875,1878,1881,1883,1886,1889,1892,1894,1897],{"class":275,"line":276},[273,1876,1877],{"class":286},"await",[273,1879,1880],{"class":293}," useStorage",[273,1882,416],{"class":297},[273,1884,1885],{"class":463},"'cache'",[273,1887,1888],{"class":297},").",[273,1890,1891],{"class":293},"removeItem",[273,1893,416],{"class":297},[273,1895,1896],{"class":463},"'nitro:functions:getAccessToken:default.json'",[273,1898,472],{"class":297},[712,1900,1902],{"id":1901},"normalizing-cache-keys","Normalizing Cache Keys",[348,1904,1905],{},[236,1906,1907,1910,1911,1547,1914,1917,1918,786,1921,1924,1925,1928],{},[1615,1908,1909],{},"Cache keys are automatically normalized"," using an internal utility that removes non-alphanumeric characters such as ",[240,1912,1913],{},"/",[240,1915,1916],{},"-",". This behavior helps ensure compatibility across various storage backends (e.g., ",[240,1919,1920],{},"file systems",[240,1922,1923],{},"key-value"," stores) that might have restrictions on characters in ",[240,1926,1927],{},"keys",", and also prevents potential path traversal vulnerabilities.",[236,1930,1931],{},"For example:",[263,1933,1935],{"className":265,"code":1934,"language":268,"meta":269,"style":269},"getKey: () => '/api/products/sale-items'\n",[240,1936,1937],{"__ignoreMap":269},[273,1938,1939,1941,1943,1945],{"class":275,"line":276},[273,1940,1744],{"class":293},[273,1942,1829],{"class":297},[273,1944,308],{"class":286},[273,1946,1947],{"class":463}," '/api/products/sale-items'\n",[236,1949,1950],{},"Would generate a key like:",[263,1952,1954],{"className":265,"code":1953,"language":268,"meta":269,"style":269},"api/productssaleitems.json\n",[240,1955,1956],{"__ignoreMap":269},[273,1957,1958,1961,1963],{"class":275,"line":276},[273,1959,1960],{"class":297},"api",[273,1962,1913],{"class":286},[273,1964,1965],{"class":297},"productssaleitems.json\n",[236,1967,1968],{},"This behavior may result in keys that look different from the original route or identifier.",[1970,1971,1972],"tip",{},[236,1973,1974,1975,1978],{},"To manually reproduce the same normalized key pattern used by Nitro (e.g., when invalidating cache entries), you can use the ",[240,1976,1977],{},"escapeKey"," utility function provided below:",[263,1980,1982],{"className":265,"code":1981,"language":268,"meta":269,"style":269},"function escapeKey(key: string | string[]) {\n  return String(key).replace(/\\W/g, \"\");\n}\n",[240,1983,1984,2009,2041],{"__ignoreMap":269},[273,1985,1986,1989,1992,1994,1997,1999,2001,2004,2006],{"class":275,"line":276},[273,1987,1988],{"class":286},"function",[273,1990,1991],{"class":293}," escapeKey",[273,1993,416],{"class":297},[273,1995,1996],{"class":301},"key",[273,1998,428],{"class":286},[273,2000,431],{"class":326},[273,2002,2003],{"class":286}," |",[273,2005,431],{"class":326},[273,2007,2008],{"class":297},"[]) {\n",[273,2010,2011,2013,2015,2018,2021,2023,2025,2028,2030,2033,2035,2038],{"class":275,"line":283},[273,2012,483],{"class":286},[273,2014,1791],{"class":293},[273,2016,2017],{"class":297},"(key).",[273,2019,2020],{"class":293},"replace",[273,2022,416],{"class":297},[273,2024,1913],{"class":463},[273,2026,2027],{"class":326},"\\W",[273,2029,1913],{"class":463},[273,2031,2032],{"class":286},"g",[273,2034,786],{"class":297},[273,2036,2037],{"class":463},"\"\"",[273,2039,2040],{"class":297},");\n",[273,2042,2043],{"class":275,"line":314},[273,2044,696],{"class":297},[236,2046,2047,2048,2051],{},"It's recommended to use ",[240,2049,2050],{},"escapeKey()"," when invalidating manually using route paths or identifiers to ensure consistency with Nitro's internal key generation.",[236,2053,2054,2055,2057],{},"For example, if your ",[240,2056,1744],{}," function is:",[263,2059,2061],{"className":265,"code":2060,"language":268,"meta":269,"style":269},"getKey: (id: string) => `product/${id}/details`\n",[240,2062,2063],{"__ignoreMap":269},[273,2064,2065,2067,2069,2072,2074,2076,2078,2080,2083,2085],{"class":275,"line":276},[273,2066,1744],{"class":293},[273,2068,527],{"class":297},[273,2070,2071],{"class":301},"id",[273,2073,428],{"class":286},[273,2075,431],{"class":326},[273,2077,305],{"class":297},[273,2079,308],{"class":286},[273,2081,2082],{"class":463}," `product/${",[273,2084,2071],{"class":297},[273,2086,2087],{"class":463},"}/details`\n",[236,2089,2090,2091,2094],{},"And you want to invalidate ",[240,2092,2093],{},"product/123/details",", you would do:",[263,2096,2098],{"className":265,"code":2097,"language":268,"meta":269,"style":269},"const normalizedKey = escapeKey('product/123/details')\nawait useStorage('cache').removeItem(`nitro:functions:getProductDetails:${normalizedKey}.json`)\n",[240,2099,2100,2118],{"__ignoreMap":269},[273,2101,2102,2104,2107,2109,2111,2113,2116],{"class":275,"line":276},[273,2103,1771],{"class":286},[273,2105,2106],{"class":326}," normalizedKey",[273,2108,410],{"class":286},[273,2110,1991],{"class":293},[273,2112,416],{"class":297},[273,2114,2115],{"class":463},"'product/123/details'",[273,2117,472],{"class":297},[273,2119,2120,2122,2124,2126,2128,2130,2132,2134,2137,2140,2143],{"class":275,"line":283},[273,2121,1877],{"class":286},[273,2123,1880],{"class":293},[273,2125,416],{"class":297},[273,2127,1885],{"class":463},[273,2129,1888],{"class":297},[273,2131,1891],{"class":293},[273,2133,416],{"class":297},[273,2135,2136],{"class":463},"`nitro:functions:getProductDetails:${",[273,2138,2139],{"class":297},"normalizedKey",[273,2141,2142],{"class":463},"}.json`",[273,2144,472],{"class":297},[2146,2147,2148],"style",{},"html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}",{"title":269,"searchDepth":283,"depth":283,"links":2150},[2151,2152,2155,2156,2157,2158],{"id":233,"depth":283,"text":234},{"id":377,"depth":283,"text":378,"children":2153},[2154],{"id":714,"depth":314,"text":715},{"id":972,"depth":283,"text":973},{"id":1273,"depth":283,"text":1274},{"id":260,"depth":283,"text":1541},{"id":1700,"depth":283,"text":1701,"children":2159},[2160],{"id":1901,"depth":314,"text":1902},"Nitro provides a caching system built on top of the storage layer.","md",{"icon":45},{"icon":45},{"title":42,"description":2161},"uQpV8FiMM4tiyj6Tj7T-tJYRpNcOE1J8COsi8kgHr5Y",[2168,2170],{"title":37,"path":38,"stem":39,"description":2169,"icon":40,"children":-1},"Nitro provides a built-in and lightweight SQL database layer.",{"title":47,"path":48,"stem":49,"description":2171,"icon":50,"children":-1},"Nitro provides a built-in fetch API that can be used to get data from server endpoints or from other sources. It's built on top of the ofetch.",1775118356726]