mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Only cache list and king pages for 1 minute
This commit is contained in:
parent
0a90a4119f
commit
4272d7b687
1 changed files with 3 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import { getNetlifyRedirect } from '~/helpers/config-node.js'
|
||||||
|
|
||||||
|
|
||||||
const ONE_SECOND = 1
|
const ONE_SECOND = 1
|
||||||
|
const ONE_MINUTE = 60
|
||||||
const ONE_HOUR = 60 * 60
|
const ONE_HOUR = 60 * 60
|
||||||
const TWELVE_HOURS = 12 * ONE_HOUR
|
const TWELVE_HOURS = 12 * ONE_HOUR
|
||||||
|
|
||||||
|
|
@ -25,12 +26,12 @@ function getMaxAgeForUrl ( Astro ) {
|
||||||
|
|
||||||
// Top level list pages
|
// Top level list pages
|
||||||
if ( topLevelListPages.has( urlPath ) ) {
|
if ( topLevelListPages.has( urlPath ) ) {
|
||||||
return TWELVE_HOURS
|
return ONE_MINUTE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kind page
|
// Kind page
|
||||||
if ( requestUrl.pathname.startsWith( '/kind/' ) ) {
|
if ( requestUrl.pathname.startsWith( '/kind/' ) ) {
|
||||||
return TWELVE_HOURS
|
return ONE_MINUTE
|
||||||
}
|
}
|
||||||
|
|
||||||
return ONE_SECOND
|
return ONE_SECOND
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue