Appearance
Setup And CLI
New projects
Scaffold cache during project creation:
bash
npm create holo-js@latest my-app -- --package cacheThat adds @holo-js/cache, writes config/cache.ts, and adds CACHE_PREFIX to .env files.
Existing projects
Install cache into an existing app:
bash
npx holo install cachePick an explicit driver when needed:
bash
npx holo install cache --driver file
npx holo install cache --driver redis
npx holo install cache --driver databasefile is the default installer driver and the default runtime driver.
Install output by driver:
file- installs
@holo-js/cache - writes
config/cache.ts - writes
CACHE_PREFIX=
- installs
redis- installs
@holo-js/cacheand@holo-js/cache-redis - writes
config/cache.ts - writes
config/redis.tsif missing - writes
CACHE_PREFIX=
- installs
database- installs
@holo-js/cacheand@holo-js/cache-db - writes
config/cache.ts - writes
CACHE_PREFIX= - prints
holo cache:tableas the follow-up table-generation command
- installs
Cache maintenance commands
Clear the default cache store:
bash
npx holo cache:clearClear a named cache store:
bash
npx holo cache:clear --driver redisForget one key from the default cache store:
bash
npx holo cache:forget dashboard.statsForget one key from a named cache store:
bash
npx holo cache:forget dashboard.stats --driver redisDatabase cache tables
If your cache driver is database, generate the migration and then migrate normally:
bash
npx holo cache:table
npx holo migratecache:table creates a normal app migration under server/db/migrations. Holo-JS does not hide cache tables inside a package.
Typical setup flows
File cache
bash
npx holo install cache --driver fileRedis cache
bash
npx holo install cache --driver redisUse npx holo cache:clear --driver redis later when you need to clear existing Redis cache state during migration or troubleshooting.
Database cache
bash
npx holo install cache --driver database
npx holo cache:table
npx holo migrate