add server cache
This commit is contained in:
parent
26c028e4ac
commit
5da5ded55a
@ -61,7 +61,7 @@ async function fetchPortfolio(fastifyURL, userId)
|
|||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
export const load = async ({ params, locals}) => {
|
export const load = async ({ params, locals, setHeaders}) => {
|
||||||
|
|
||||||
|
|
||||||
const userRegion = locals.region?.split("::")[0];
|
const userRegion = locals.region?.split("::")[0];
|
||||||
@ -102,11 +102,11 @@ export const load = async ({ params, locals}) => {
|
|||||||
getUserPortfolio,
|
getUserPortfolio,
|
||||||
] = await Promise.all(promises);
|
] = await Promise.all(promises);
|
||||||
|
|
||||||
/*
|
|
||||||
setHeaders({
|
setHeaders({
|
||||||
'cache-control': 'public, max-age=500'
|
'cache-control': 'public, max-age=300'
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getCryptoProfile,
|
getCryptoProfile,
|
||||||
|
|||||||
@ -85,7 +85,7 @@ async function fetchPortfolio(fastifyURL, userId)
|
|||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
export const load = async ({ params, locals}) => {
|
export const load = async ({ params, locals, setHeaders}) => {
|
||||||
|
|
||||||
const userRegion = locals.region?.split("::")[0];
|
const userRegion = locals.region?.split("::")[0];
|
||||||
|
|
||||||
@ -135,11 +135,11 @@ const promises = [
|
|||||||
getUserPortfolio,
|
getUserPortfolio,
|
||||||
] = await Promise.all(promises);
|
] = await Promise.all(promises);
|
||||||
|
|
||||||
/*
|
|
||||||
setHeaders({
|
setHeaders({
|
||||||
'cache-control': 'public, max-age=500'
|
'cache-control': 'public, max-age=300'
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getETFProfile,
|
getETFProfile,
|
||||||
|
|||||||
@ -115,7 +115,7 @@ async function fetchCommunitySentiment(pb, ticker, cookies)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const load = async ({ params, locals, cookies}) => {
|
export const load = async ({ params, locals, cookies, setHeaders}) => {
|
||||||
|
|
||||||
|
|
||||||
const userRegion = locals?.region?.split("::")[0];
|
const userRegion = locals?.region?.split("::")[0];
|
||||||
@ -174,17 +174,15 @@ export const load = async ({ params, locals, cookies}) => {
|
|||||||
getCommunitySentiment,
|
getCommunitySentiment,
|
||||||
] = await Promise.all(promises);
|
] = await Promise.all(promises);
|
||||||
|
|
||||||
/*
|
|
||||||
setHeaders({
|
setHeaders({
|
||||||
'cache-control': 'public, max-age=500'
|
'cache-control': 'public, max-age=300' //Cache data for 5 min
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getFairPrice,
|
getFairPrice,
|
||||||
getSimilarStock,
|
getSimilarStock,
|
||||||
//getPricePrediction,
|
|
||||||
//getTradingSignals,
|
|
||||||
getStockDeck,
|
getStockDeck,
|
||||||
getCorrelation,
|
getCorrelation,
|
||||||
getAnalystRating,
|
getAnalystRating,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user