Documentation Index
Fetch the complete documentation index at: https://mintlify.com/meteor/meteor/llms.txt
Use this file to discover all available pages before exploring further.
Caching Strategies
Meteor uses multiple layers of caching to optimize build performance and rebuild times. Understanding these caches helps you troubleshoot issues and optimize your development workflow.Cache Locations
Meteor maintains several disk caches:Application Caches
APP/.meteor/local/isopacks
- Built packages and plugins
- Local package compilation cache
- Core packages in checked-out mode
APP/.meteor/local/bundler-cache
- Linker output cache
- Compiler plugin results
- File processing cache
APP/.meteor/local/plugin-cache
- Build plugin cache
- Plugin-specific compilation results
APP/.meteor/local if you have data in your app’s database. The local MongoDB resides in APP/.meteor/local/db.
Global Caches
~/.meteor (Release mode)
- Package storage when running a release
- Downloaded Atmosphere packages
- Similar to Maven’s
.m2
REPO/.meteor (Checkout mode)
- Package storage when running checked-out branch
- Development package storage
Rspack Caches
When using Rspack integration:_build/
- Rspack entry points
- Intermediate Rspack app bundles
- Environment-specific contexts (dev/prod, client/server)
public/build-assets/ and private/build-assets/
- Assets built by Rspack
- Packed into final Meteor app
public/build-chunks/
- Code-split chunks from dynamic imports
- CSS generation output
- Chunk processing results
- Automatically prepared and cleared
- Added to
.gitignorewhen using Git - Should not be modified directly
- Excluded from IDE analysis (recommended)
Cache Types
Built Package Cache
Caches compiled packages to avoid recompilation:- Location:
APP/.meteor/local/isopacks - Contains: Transpiled package code, build artifacts
- Invalidated: When package source changes or version updates
Compiler Plugin Cache
Caches results from build plugins:- Location:
APP/.meteor/local/plugin-cache - Contains: Processed file outputs
- Key feature: Caches multiple versions of files
- Benefit: Toggling code back/forth may hit cache
Linker Cache
Caches linker output:- Location:
APP/.meteor/local/bundler-cache/linker - Contains: Large linked bundle files
- Issue: Very large files can take seconds to write
- Note: Files are not automatically cleaned up
Server Program Cache
Caches entire server program for client-only changes:- Benefit: Client changes don’t trigger server rebuild
- Result: Faster rebuilds for UI development
Constraint Solver Cache
Caches package version resolution:- Location:
APP/.meteor/versions - Benefit: Avoids re-solving constraints on every run
- Optimization: Previous solution checked without invoking solver
Rspack Cache Configuration
Rspack provides an additional cache layer for app code.Persistent Cache (Default)
Enabled by default for faster rebuilds:Disable Persistent Cache
For troubleshooting or memory constraints:Memory Cache
Use in-memory cache instead of persistent:- Persistent cache: Faster across restarts, uses disk space
- Memory cache: Faster during session, lost on restart
- No cache: Slowest, but no cache issues
Cache Behavior
Cold vs Warm Cache
Cold Cache (First Run)- All packages need compilation
- Constraint solver runs
- Plugins build from scratch
- Slowest build time
- Packages loaded from cache
- Incremental compilation only
- Constraint solver results reused
- Significantly faster
- Even faster than first rebuild
- All caches fully populated
- Optimal performance level
Cache Invalidation
Caches are invalidated when:- Package version changes
- Source files modified
- Meteor version updated
- Build plugin changes
- Configuration changes (.swcrc, rspack.config.js)
Release vs Checkout Differences
Release Mode:- Uses
~/.meteorfor packages - Core packages pre-built
- Faster startup
- Stable constraint solving
- Uses
REPO/.meteorfor packages - Recompiles core packages into
APP/.meteor/local/isopacks - Slower initial build
- More files watched
- Useful for development
Cache Optimization
Clear Specific Caches
Clear all caches (preserves database):Plugin Cache Management
Plugin caches are stored per package and version: Structure:- Package version for versioned packages
- “local” for local packages (emptied on rebuild)
Optimize Cache Usage
- Use entry points - Reduces files scanned and cached
- Use .meteorignore - Excludes files from watch and cache
- Minimize local packages - More packages = more cache overhead
- Pin package versions - Maintains
APP/.meteor/versions - Enable Rspack cache - Additional speed for app code
Cache Troubleshooting
Stale Cache Issues
Symptoms:- Old code still running after changes
- Build errors that don’t make sense
- Missing dependencies
Large Cache Size
Symptoms:.meteor/localdirectory very large- Slow builds despite caching
- Disk space issues
- Remove old projects’ caches
- Clear
bundler-cache/linkerperiodically - Use
meteor reseton old projects
Rspack Cache Issues
Symptoms:- Memory crashes during builds
- Inconsistent build results
- Cache-related errors
- Increase memory:
- Disable persistent cache:
- Use memory cache:
Cache in CI/CD
Docker Builds: Cache.meteor/local between builds:
Performance Considerations
Cache Impact on Performance
Disk Caches:- SSDs: Minimal impact, fast read/write
- HDDs: Significant impact, slower I/O
- Fast access during development
- Lost on restart
- Requires adequate RAM
- Package server downloads
- Can take 5+ seconds
- Consider local package mirror
Monitoring Cache Performance
Use profiling to see cache impact:_initializeCatalog- Package cache loading_resolveConstraints- Constraint solver cachebundler.readJsImage- Compiled package cache
Best Practices
-
Don’t commit caches - Add to
.gitignore: - Use meteor reset sparingly - Clears all caches and database
- Clear caches when troubleshooting - Often fixes mysterious issues
- Cache in CI/CD - Speeds up build pipelines
- Monitor cache size - Prevent disk space issues
- Use Rspack cache wisely - Balance speed vs memory usage
- Understand cache layers - Know which cache to clear for issues
- Pin dependencies - Maintains stable cache keys