File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ export async function GET(request: Request) {
106106 : year
107107 ? `${ year } -12-31T23:59:59Z`
108108 : undefined ;
109+ const currentYear = new Date ( ) . getUTCFullYear ( ) ;
110+ const isHistoricalYear = ! ! year && Number ( year ) < currentYear ;
109111
110112 let timezone = 'UTC' ;
111113 if ( tzParam ) {
@@ -224,7 +226,9 @@ export async function GET(request: Request) {
224226 : getSecondsUntilUTCMidnight ( ) ;
225227 const cacheControl = refresh
226228 ? 'no-cache, no-store, must-revalidate'
227- : `public, s-maxage=${ secondsToMidnight } , stale-while-revalidate=86400` ;
229+ : isHistoricalYear
230+ ? 'public, s-maxage=31536000, immutable'
231+ : `public, s-maxage=${ secondsToMidnight } , stale-while-revalidate=86400` ;
228232
229233 return new NextResponse ( svg , {
230234 headers : {
You can’t perform that action at this time.
0 commit comments