Use case or problem
Several plugins use their settings data to cache things to disk. For example, “Novel Word Count” has a section for cached data, and “Enhanced Annotations” keeps track of inactivity. This use of the data.json creates a ton of unneeded changes in the files for those of us who use git to version our vaults. Usually, I would add the cache data to a .gitignore file, as I have done for the workspace.json file. But this data is being stored in the same file as the settings data for the plugins, which is something I want to commit to my repo.
Proposed solution
In the same way obsidian provides the save and load data functions to plugins, it should provide an API for a dedicated disk cache. This could be adding a “cache.json” to the plugin folders, or a singular json file that each plugin gets a key inside. This way, the data that is constantly changing on disk can be .gitignore’d.
Current workaround (optional)
Thus far, I’ve worked around this for “Enhanced Annotations” by going into the code and commenting out anything that deals with plugin inactivity, so it isn’t constantly modifying data.json. I shouldn’t have to do this. And now “Novel Word Count” has a similar problem, but the whole purpose behind that plugin is that it caches its data, so this isn’t something I can just change.
Related feature requests (optional)
TBD