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