reduce cache maxage

This commit is contained in:
spencerwooo 2022-02-10 23:06:11 +08:00
parent 2686197b4a
commit 03163e9d32
No known key found for this signature in database
GPG key ID: 24CD550268849CA0
5 changed files with 5 additions and 5 deletions

View file

@ -9,7 +9,7 @@ const HomeCrumb = () => {
return (
<Link href="/">
<a>
<a className="flex items-center">
<FontAwesomeIcon className="h-3 w-3" icon={['far', 'flag']} />
<span className="ml-2 font-medium">{t('Home')}</span>
</a>

View file

@ -133,7 +133,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Set edge function caching for faster load times, check docs:
// https://vercel.com/docs/concepts/functions/edge-caching
res.setHeader('Cache-Control', 'max-age=60, s-maxage=3600, stale-while-revalidate')
res.setHeader('Cache-Control', 'max-age=0, s-maxage=600, stale-while-revalidate')
// Sometimes the path parameter is defaulted to '[...path]' which we need to handle
if (path === '[...path]') {

View file

@ -13,7 +13,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Set edge function caching for faster load times, check docs:
// https://vercel.com/docs/concepts/functions/edge-caching
res.setHeader('Cache-Control', 'max-age=60, s-maxage=3600, stale-while-revalidate')
res.setHeader('Cache-Control', 'max-age=0, s-maxage=600, stale-while-revalidate')
if (typeof id === 'string') {
const itemApi = `${apiConfig.driveApi}/items/${id}`

View file

@ -34,7 +34,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Set edge function caching for faster load times, check docs:
// https://vercel.com/docs/concepts/functions/edge-caching
res.setHeader('Cache-Control', 'max-age=60, s-maxage=3600, stale-while-revalidate')
res.setHeader('Cache-Control', 'max-age=0, s-maxage=600, stale-while-revalidate')
if (typeof searchQuery === 'string') {
// Construct Microsoft Graph Search API URL, and perform search only under the base directory

View file

@ -17,7 +17,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Set edge function caching for faster load times, check docs:
// https://vercel.com/docs/concepts/functions/edge-caching
res.setHeader('Cache-Control', 'max-age=60, s-maxage=3600, stale-while-revalidate')
res.setHeader('Cache-Control', 'max-age=0, s-maxage=600, stale-while-revalidate')
// Check whether the size is valid - must be one of 'large', 'medium', or 'small'
if (size !== 'large' && size !== 'medium' && size !== 'small') {