Skip to content

edlaver/cf-notion-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Routes:

POST /cache/{pageId}

Triggers the job to fetch the page from Notion:

  • Retrieve recordMap from Notion by pageId
  • Load the recordMap from KV, and compare first block > type:page > version numbers, return if same.
  • Loop over images
    • Look up each image in images API by ID+Version
    • If no match,
      • Store into images API with key of ID+Version
      • Rewrite signed image URL with stored image URL
  • Store recordMap into KV by pageId

GET /cache/{pageId}

Loads the recordMap from KV and returns it:

  • Load the recordMap from KV by pageId
    • If not found, cache it using same function as /cache endpoint
  • Returns the recordMap

About

Cloudflare Workers based cache for Notion pages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published