DefLoadCache
Cut your modded RimWorld launch time by up to 45%.
Tired of waiting 10-15 minutes every time you launch your 500+ mod list? DefLoadCache caches the results of mod loading so you don’t pay that cost every single time.
Every time RimWorld launches, it reads thousands of XML files from every mod and then applies thousands of XML patches (compatibility fixes, balance changes, etc). On large mod lists, this takes 5-7 minutes, and it does it from scratch every launch, even if nothing changed.
DefLoadCache saves the result after the first launch. On every launch after that with the same mod list, it loads the cached result in seconds instead of redoing all that work.
Tested on a 576-mod Combat Extended milsim load order:
- Total launch time: ~14 min to ~8 min (45% faster)
- Mod XML loading + patching: ~6 min to ~23 seconds
- Cache size: ~7 MB per mod list
Your results will vary based on mod count, hardware, and which mods you run. Larger mod lists see bigger improvements.
- Works with any mod manager. RimPy, RimSort, or manual. DefLoadCache fingerprints whatever mods are active regardless of how they got there. Each mod list configuration gets its own cache automatically.
- Automatic cache invalidation. The cache rebuilds automatically when you add, remove, or update mods. No manual clearing needed.
- Multiple mod list profiles. Keeps separate caches for different mod lists. Switch between RimPy profiles without losing your cached data.
- Per-feature toggles. Independently enable/disable "skip reading mod files" and "skip applying patches" from mod settings.
- Safe fallback. If anything goes wrong, the game loads normally as if DefLoadCache isn’t installed. No risk of save corruption.
- Zero gameplay impact. Only affects load time. No changes to gameplay, defs, or balance.
DefLoadCache is designed to never cause problems for other mods. If something goes wrong, it catches itself:
- Post-load validation. On every cache hit, the mod verifies per-mod def counts against the baseline stored when the cache was built. If anything doesn’t match, the bad cache is automatically deleted.
- Self-healing. A bad cache never survives two launches. Validation failure forces a clean uncached load on the next restart.
- One-click isolation testing. Click "Test without cache (next launch only)" in mod settings to check if an issue is cache-related. The cache is preserved and re-enables automatically.
- Structured log output. Every launch emits a status block in the log showing cache state and validation results. Modders reviewing player logs can instantly see whether DefLoadCache was involved in a reported issue.
If a player files a bug report with DefLoadCache installed, search their log for "DefLoadCache Status". You’ll see the cache state, validation result, and whether the cache served correct data. If there’s any doubt, ask the player to click "Test without cache (next launch only)" in mod settings and reproduce the issue.
Q: Will this break my save?
No. DefLoadCache only affects how fast the game loads. It doesn’t change any defs, gameplay mechanics, or save data. You can add or remove it at any time.
Q: Do I need to clear the cache when I change mods?
No. The cache automatically detects when your mod list, mod versions, or DLLs change and rebuilds from scratch. You should never need to manually clear the cache under normal use.
Q: Why is the first launch still slow?
The first launch with a new mod list has to build the cache. It runs everything normally and saves the result. Every launch after that is faster.
Q: What if I’m developing a mod?
Go to Options > Mod Settings > DefLoadCache and disable "Skip reading mod files" or "Skip applying patches" while you’re testing changes. Or hit "Clear all cached data" to force a full rebuild.
Q: Does this conflict with Performance Fish or RocketMan?
DefLoadCache targets a different part of the loading pipeline than most performance mods. It should work alongside them, but if you experience issues, please report them.
Q: Where are the cache files stored?
In your RimWorld save data folder under DefLoadCache/. You can see the exact path and manage cache files from the mod settings page.
Q: Is this safe to add mid-playthrough?
Yes. It only affects startup loading, not runtime gameplay. Add or remove it whenever you like.
Access via Options > Mod Settings > DefLoadCache:
- Enable/disable the mod entirely
- Toggle "skip reading mod files" and "skip applying patches" independently
- Set how many mod list profiles to keep cached (default 10)
- View cache info (size, location, last launch status)
- Clear all cached data
- Test without cache (next launch only), for one-click isolation testing
- Developer diagnostic dump for verifying correctness
- Prepatcher (required)
- RimWorld 1.6
- Place anywhere in your mod list (after Prepatcher and Harmony)
GitHub[github.com]. MIT licensed, contributions welcome.
DefLoadCache currently saves ~6 minutes on a 576-mod list. There’s more coming.
Near-term
- Per-file content checksums to avoid false cache invalidations when Steam re-downloads unchanged mods
- Binary cache format for faster cache loading
- Skip unnecessary patch validation on cached launches
- Further fingerprint optimizations
Planned
- Deferred texture loading. Load textures in the background instead of blocking startup, potentially saving another 2-3 minutes.
- Cached parsed Def objects. Skip even more of the loading pipeline for near-instant launches.
- Incremental patching. When adding a small patch mod, only apply the new patches instead of rebuilding everything.
Future vision
- Prepatcher-based runtime profiler with per-mod attribution. See which mods are costing you the most FPS with a live "top 10 mods by tick cost" overlay.
- FluxxField. Author
- Harmony by Brrainz. The patching library that Prepatcher and most RimWorld mods are built on.
- Prepatcher by Zetrith. The [FreePatch] IL injection system that makes this possible. Thanks to Jikulopo for maintaining a fork while Zetrith was away.
- Krafs.Publicizer[github.com]. Compile-time publicizer for accessing internal Cecil types.
- Performance Fish[github.com] by bbradson. Inspiration for the Publicizer + HintPath pattern.
Have ideas or want to contribute? Check the source on GitHub[github.com].