Skip to content

Commit

Permalink
fix(cache): reduce stale-while-revalidate duration to 60 seconds in c…
Browse files Browse the repository at this point in the history
…ollection and item APIs
  • Loading branch information
preschian committed Aug 17, 2024
1 parent 4a8c041 commit b4a070a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ogi/server/api/evm/[chain]/collection/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineEventHandler(async (event) => {
// set headers access-control-origin
setHeader(event, 'Access-Control-Allow-Origin', '*')
// set headers swr cache 5 minutes
setHeader(event, 'Cache-Control', 'public, max-age=300, s-maxage=300, stale-while-revalidate=86400')
setHeader(event, 'Cache-Control', 'public, max-age=300, s-maxage=300, stale-while-revalidate=60')

return {
metadata,
Expand Down
2 changes: 1 addition & 1 deletion ogi/server/api/evm/[chain]/item/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
// set headers access-control-origin
setHeader(event, 'Access-Control-Allow-Origin', '*')
// set headers swr cache 5 minutes
setHeader(event, 'Cache-Control', 'public, max-age=300, s-maxage=300, stale-while-revalidate=86400')
setHeader(event, 'Cache-Control', 'public, max-age=300, s-maxage=300, stale-while-revalidate=60')

return {
item,
Expand Down

0 comments on commit b4a070a

Please sign in to comment.