diff --git a/README.md b/README.md index 6037b1c..0739853 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,10 @@ Pre-fetches a remote component for faster access. - `DEBUG=true` - Enable debug logging for the Node.js loader - `NODE_ENV=development` - Enable hot reload for Metro resolver +- `IOR_CACHE_TTL` - Control cache duration in milliseconds + - `IOR_CACHE_TTL=0` - Disable caching (always fetch fresh) + - `IOR_CACHE_TTL=60000` - 1 minute cache (useful during development) + - Default: 3600000 (1 hour) ### Cache Configuration @@ -219,12 +223,34 @@ The resolver uses different cache locations for different environments: - **Metro**: `.ior-cache/remote/` in project root - **Node.js**: OS temp directory under `metatrom-components/remote/` -- **Default TTL**: 1 hour (3600000ms) +- **Default TTL**: 1 hour (3600000ms) - configurable via `IOR_CACHE_TTL` ### Cache Persistence Metro resolver maintains a persistent cache mapping in `.ior-cache/mappings.json` for faster startup times. +### Cache Management During Development + +When working with frequently changing remote components: + +```bash +# Disable cache completely (always fetch fresh) +IOR_CACHE_TTL=0 npm start + +# Use short cache duration (1 minute) +IOR_CACHE_TTL=60000 npm start + +# Clear cache manually +rm -rf .ior-cache/remote/* + +# Or add to package.json scripts: +"scripts": { + "dev:no-cache": "IOR_CACHE_TTL=0 npm start", + "dev:short-cache": "IOR_CACHE_TTL=60000 npm start", + "clear-cache": "rm -rf .ior-cache/remote/*" +} +``` + ## Architecture The package is designed with a shared core architecture: