mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-22 09:23:16 +01:00
response caching
This commit is contained in:
parent
d1adc49455
commit
0c3eecd681
@ -20,7 +20,7 @@ export async function GET(request: NextRequest) {
|
|||||||
return Response.json(null, { status: 400 })
|
return Response.json(null, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = `${apiUrl}/prices/?tokens=${tokens}`
|
const url = `${apiUrl}/prices?tokens=${tokens}`
|
||||||
let data
|
let data
|
||||||
let status
|
let status
|
||||||
|
|
||||||
@ -39,7 +39,8 @@ export async function GET(request: NextRequest) {
|
|||||||
return new Response(JSON.stringify(data), {
|
return new Response(JSON.stringify(data), {
|
||||||
status,
|
status,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Cache-Control': 'public, s-max-age=60'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,8 @@ export async function GET(request: NextRequest) {
|
|||||||
return new Response(JSON.stringify(data), {
|
return new Response(JSON.stringify(data), {
|
||||||
status,
|
status,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Cache-Control': 'public, s-maxage=10'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user