agency-kit / notion-cms

Add super powers to Notion by making it your full-fledged headless CMS.

Home Page:https://www.agencykit.so/notion-cms/guide/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use an in memory cache to avoid frequent JSON ops and disk writes.

earlAchromatic opened this issue · comments

Description

Proposing an enhancement to optimize our API data caching strategy, addressing performance issues related to file I/O and JSON processing.

Proposed Enhancement

  • Implement HTTP caching using headers like ETag and Last-Modified.
  • Create a separate caching module to manage in-memory and disk-based caching efficiently.
  • Enforce singleton pattern for the caching module to maintain state across the application.
  • Optimize file operations and JSON handling for better performance.
  • Document the caching strategy and ensure consistency across the team.

Goals

  • Improve performance by reducing unnecessary network traffic and data processing.
  • Enhance maintainability and scalability of the caching mechanism.

Next Steps

  • Select Node.js libraries for HTTP and in-memory caching.
  • Develop and integrate the separate caching module.
  • Update documentation with guidelines on caching module usage.
  • Implement tests and tooling to ensure adherence to new caching strategy.
  • Monitor performance impact after implementation.

It's possible this will be v1 compatible since we keep the disk cache, just use it less frequently.