@@ -8,24 +8,35 @@ export const USER_AGENT =
88
99export const REPOSITORY_SLUG = "jakejarvis/domainstack.io" ;
1010
11+ // Time constants (in seconds)
12+ const ONE_MINUTE = 60 ;
13+ const ONE_HOUR = ONE_MINUTE * 60 ;
14+ const ONE_DAY = ONE_HOUR * 24 ;
15+ const ONE_WEEK = ONE_DAY * 7 ;
16+
1117/**
1218 * RDAP Bootstrap Registry URL from IANA.
1319 * This JSON file maps TLDs to their authoritative RDAP servers.
1420 * @see https://datatracker.ietf.org/doc/html/rfc7484
1521 */
1622export const RDAP_BOOTSTRAP_URL = "https://data.iana.org/rdap/dns.json" ;
23+ /**
24+ * RDAP Bootstrap cache TTL in seconds.
25+ * The bootstrap registry changes very infrequently, so we cache it for 1 week.
26+ */
27+ export const RDAP_BOOTSTRAP_CACHE_TTL_SECONDS = ONE_WEEK ;
1728
1829/**
1930 * Cloudflare IP Ranges URL.
2031 * This JSON file contains the IP ranges for Cloudflare's network.
2132 * @see https://developers.cloudflare.com/api/resources/ips/methods/list/
2233 */
2334export const CLOUDFLARE_IPS_URL = "https://api.cloudflare.com/client/v4/ips" ;
24-
25- // Time constants ( in seconds)
26- const ONE_HOUR = 60 * 60 ;
27- const ONE_DAY = 24 * ONE_HOUR ;
28- const ONE_WEEK = 7 * ONE_DAY ;
35+ /**
36+ * Cloudflare IP Ranges cache TTL in seconds.
37+ * The IP ranges change infrequently, so we cache it for 1 week.
38+ */
39+ export const CLOUDFLARE_IPS_CACHE_TTL_SECONDS = 604800 ; // 1 week
2940
3041// ===== Blob Storage Cache TTLs =====
3142// How long to cache uploaded assets (favicons, screenshots, social images)
0 commit comments