In order to save hundreds/thousands calls to the Notion API, we'd like to cache pages' blocks query locally, based on the pages' last_edited_time property.
[ ] After each database content queries, re-write the formatted pages result inside a file.
Page result should only hold id and last_edited_time properties.
File name should hold the --new prefix, in order to compare with previous cached list.
[ ] Before pages' blocks queries, look for an existing database's pages cache file and identify pages which has been updated since the last run.
Cached file name should hold --old prefix.
[ ] Run a pages' blocks query for every updated pages.
[ ] After the pages' blocks queries, write a single file for every page + blocks objects.
A file should simply be named after page id.
[ ] Delete --old file, and rename the --new one to --old.
[ ] Load all cached pages and run the createPage routine for all of them.
In order to save hundreds/thousands calls to the Notion API, we'd like to cache pages' blocks query locally, based on the pages'
last_edited_time
property.[ ] After each database content queries, re-write the formatted pages result inside a file.
id
andlast_edited_time
properties.--new
prefix, in order to compare with previous cached list.[ ] Before pages' blocks queries, look for an existing database's pages cache file and identify pages which has been updated since the last run.
--old
prefix.[ ] Run a pages' blocks query for every updated pages.
[ ] After the pages' blocks queries, write a single file for every page + blocks objects.
id
.[ ] Delete
--old
file, and rename the--new
one to--old
.[ ] Load all cached pages and run the
createPage
routine for all of them.