Skip to content

Commit

Permalink
Disable cache?
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Aug 30, 2024
1 parent a64f45a commit 45a07ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/resolve-notion-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export async function resolveNotionPage(domain: string, rawPageId?: string) {
const useUriToPageIdCache = true
const cacheKey = `uri-to-page-id:${domain}:${environment}:${rawPageId}`
// TODO: should we use a TTL for these mappings or make them permanent?
const cacheTTL = 8.64e7 // one day in milliseconds
// const cacheTTL = undefined // disable cache TTL
// const cacheTTL = 8.64e7 // one day in milliseconds
const cacheTTL = undefined // disable cache TTL

if (!pageId && useUriToPageIdCache) {
try {
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = withBundleAnalyzer({
{ hostname: 's3.us-west-2.amazonaws.com' },
{ hostname: 'cdn.jsdelivr.net' }
],
minimumCacheTTL: 60,
// minimumCacheTTL: 60,
formats: ['image/avif', 'image/webp'],
dangerouslyAllowSVG: true,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;"
Expand Down
3 changes: 2 additions & 1 deletion pages/api/recent-posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ type Response = {
*/
export default async function (req: NextApiRequest, res: NextApiResponse) {
const siteMap = await getSiteMap()
const ttl = 24 * 60 * 60 // 24 hours
// const ttl = 24 * 60 * 60 // 24 hours
const ttl = undefined // disable cache TTL
const data: Response = {
posts: []
}
Expand Down

0 comments on commit 45a07ac

Please sign in to comment.