Cache Skill

describe how to write cache related code in the codebase, use when you need to add or modify cache related code or user ask to optimize the cache related code to the codebase Use when this capability is needed.

tomevault-io Updated

File contents

cache best practices

the document outlines the best practices for writing cache related code in the codebase.

when to use this skill

when you need to add or modify cache related code or user ask to optimize the cache related code to the codebase

best practices

  • you should always try to use transaction within cache operation whenever possible to ensure data consistency, and rollback the transaction if the operation failed
  • you should separate different cache value into different database to have better maintainability, don't put all the cache value into the same database
  • you should always try to use cache eviction policy to ensure the cache value is always up to date
  • you should always try to use sorted set instead of list to store ordered data
  • you should try to use cuckoo filter when you need fast lookup if data present or not

Source: ambersun1234/skills — distributed by TomeVault.

tomevault-io/skills-registry/tree/main/ambersun1234--skills--cache-skill commit 161daa6f82

Frequently asked questions

npx skillmds@latest add tomevault-io/cache-skill