Let mods invalidate content cache by name or type
Pathoschild opened this issue ยท 2 comments
Let mods invalidate the cache for a specific content asset name or type:
helper.Content.InvalidateCache(assetName);
helper.Content.InvalidateCache<T>();
SMAPI should detect whether a game static is invalidated, and only reload affected statics.
I would suggest batchjing any InvalidateCache
calls and only perform a single invalidation sweep at the end of a Update call, after all events have been processed.
Invalidating a file immediately once requested might have some edge-case uses, but the CPU and GPU performance improvements by limiting how often invalidation can happen is, I feel, worth it.