SkinChangerMod

SkinChangerMod

4.2k Downloads

Provide automatic Skin and Cape caching

boomboompower opened this issue ยท 2 comments

commented

Skins in the cache should not stay forever. SkinChanger V2 introduced a skin cache which never automatically clears, V3 can feature one that does.

The implementation of manual clearing should stay, however automatic cache cleaning is definitely something which would benefit users. Users should be able to choose caching times, or disable the cache clearing method completely.


General implementation

  • Create system which saves items in a cache
  • When an item is requested the cache will be checked first, if the item exists in the cache it should be retrieved
  • Cache should expire after a certain period of time (Configurable??)
  • Cache should automatically cause items to expire (see Recommended steps)

Recommended steps

  • On preInit, scan all caches on a separate thread
  • Delete any caches which are found to be expired.

And also when a resource is queried

  • Scan its cache
  • Delete it if it has expired
commented

Implemented in 861c85b

Needs testing. The mod only checks each cache file if it's needed, some files may remain in the cache for a long time if they are not scanned. I might add something to check the cache on startup?

commented

Ok so 82e174c solves an issue where cached files were being created, however the code didn't actually retrieve them if it could. So 82e174c is just a fix for that crappy implementation (the current codebase will currently bypass the fix if it uses the old method).

Should make the mod work a bit better offline now.