Fix the issue where Obsidian is stuck at "Loading cache..." and cannot start.
When to Use
- Obsidian gets stuck at "Loading cache..." when starting up
- The vault has a large number of files, including many non-markdown files (such as node_modules)
- Suspect the cache is corrupted
Workflow
Step 1: Confirm Obsidian is closed
pgrep -x Obsidian && echo "Obsidian 正在运行,请先关闭" || echo "OK: Obsidian 未运行"
If Obsidian is running, prompt the user to close it first.
Step 2: Clear the IndexedDB cache
rm -rf ~/Library/Application\ Support/obsidian/IndexedDB/
Step 3: Prompt the user to reopen Obsidian
Inform the user:
- The cache has been cleared
- Reopen Obsidian; the first load will be a bit slower (rebuilding the index)
- If the vault contains a large number of non-markdown files such as node_modules, it is recommended to create a
.obsidianignorefile to exclude them
Optional: Create .obsidianignore
If the user's vault contains node_modules or other directories that should be ignored, help the user create the following in the vault root directory:
node_modules
.git
.output
dist
build
Notes
- This operation only affects macOS
- What is cleared is the global cache, which will affect the index of all vaults
- User data, notes, and plugin configurations will not be deleted