NoBo implements intelligent caching that works in both local development and CI/CD environments like Cloudflare Pages, Netlify, and GitHub Actions.
NoBo uses a fallback cascade of caching strategies:
- Local Cache (
.nobo-cache.json) - Fastest, for local development - Git-Based Cache (
.build-marker) - For git repositories with build history - CI Cache (File timestamps) - For CI environments without git history
Build Request
β
Try Local Cache (.nobo-cache.json)
β (if fails)
Try Git-Based Cache (.build-marker)
β (if fails)
Try CI Cache (file timestamps)
β (if fails)
Force Full Rebuild
.nobo-cache.json- Contains content hashes and build metadataout/.build-marker- Git commit-based build marker (if in git repo)
- File timestamps - Checks if content files changed since last build
- Build artifacts - Reuses existing build if recent and unchanged
NoBo sites work with any static hosting platform without host-specific configuration files. The caching system is platform-agnostic.
All platforms use the same simple setup:
- Build command:
npm run build - Output directory:
out - Node.js version: 18+ (recommended)
- Build command:
npm run build - Build output directory:
out - Node.js version: 18
- Build command:
npm run build - Publish directory:
out - Node.js version: 18
- Build command:
npm run build - Output directory:
out - Node.js version: 18
- name: Build NoBo site
run: npm run build
env:
# Optional: Force rebuild in CI
# FORCE_REBUILD: 1- Build command:
npm run build - Static files directory:
out - Node.js version: 18+
- First build: Normal speed
- No changes: Instant (uses local cache)
- Content changes: Only rebuilds affected pages
- Fresh environment: Full build (expected)
- Content unchanged: Can reuse recent builds (CI cache)
- Git-based: Can detect changes since last commit
# Local development
FORCE_REBUILD=1 npm run build
# CI/CD environments
# Set FORCE_REBUILD=1 in environment variables- Automatic: Content files changed
- Manual: Delete
.nobo-cache.jsonor setFORCE_REBUILD=1 - Git: New commits automatically invalidate git-based cache
- When: Local development with existing cache file
- How: Compares MD5 hashes of content files
- Speed: Instant for unchanged content
- Fallback: Git-based cache if cache file corrupted
- When: Git repository with build marker
- How: Compares current commit with build marker commit
- Speed: Very fast, uses git diff
- Fallback: CI cache if git operations fail
- When: CI environment with recent build artifacts
- How: Checks file modification times
- Speed: Moderate, scans content directory
- Fallback: Full rebuild
-
Check cache files exist:
ls -la .nobo-cache.json out/.build-marker
-
Force rebuild:
FORCE_REBUILD=1 npm run build
-
Clear all caches:
rm .nobo-cache.json out/.build-marker npm run build
- Ensure git history is available (
fetch-depth: 0in GitHub Actions) - Check build artifacts are preserved between builds
- Verify content directory structure is correct
- Large sites: Consider incremental builds for specific content types
- Slow CI: Use build caching in CI platform settings
- Memory issues: Monitor build process memory usage
The build process shows which cache strategy is being used:
π Checking for content changes...
π Using local cache strategy
β
No content changes detected. Using cached build...
Or:
π Checking for content changes...
π Using ci cache strategy
π Detected changes in: modified:posts/hello-world.json
NoBo works out of the box with any static hosting platform. No host-specific configuration files required.
All platforms use the same simple setup:
- Build command:
npm run build - Output directory:
out - Node.js version: 18+ (recommended)
Simply configure your hosting platform with:
- Build command:
npm run build - Output/publish directory:
out - Node.js version: 18
If you need to force a rebuild in CI environments:
FORCE_REBUILD=1 npm run build- β No vendor lock-in - Works everywhere
- β Easy migration between platforms
- β Standard Node.js build process
- β No configuration files to maintain
- β Works with any CI/CD system
- Commit frequently to enable git-based caching
- Use local cache for rapid development iterations
- Force rebuild when debugging build issues
- Enable build caching in your CI platform
- Preserve build artifacts between builds when possible
- Use git history for better change detection
- Monitor build times and adjust cache strategies as needed
- Consider content chunking for very large content directories
- Use CDN caching for static assets
- Monitor cache hit rates and optimize accordingly
- Local: Instant rebuilds for unchanged content
- CI: 30-60 seconds for full builds
- Cache hit: 5-10 seconds
- Local: 1-2 seconds for unchanged content
- CI: 2-5 minutes for full builds
- Cache hit: 30-60 seconds
- Local: 5-10 seconds for unchanged content
- CI: 10-30 minutes for full builds
- Cache hit: 2-5 minutes
The caching system scales with your content and provides significant time savings for both development and deployment workflows.