SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Let mods invalidate content cache by name or type

Pathoschild opened this issue ยท 2 comments

commented

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.

commented

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.

commented

Done in develop for the upcoming release. Batching isn't implemented in this version, but we can optimise the underlying implementation later (possibly before its official release).