Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Provide automatic Skin and Cape caching #6

Open
3 of 8 tasks
boomboompower opened this issue Mar 6, 2020 · 2 comments
Open
3 of 8 tasks

Provide automatic Skin and Cape caching #6

boomboompower opened this issue Mar 6, 2020 · 2 comments
Labels
in progress This feature is actively being worked on needs testing A new feature has not been tested

Comments

@boomboompower
Copy link
Owner

boomboompower commented Mar 6, 2020

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
@boomboompower
Copy link
Owner Author

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?

@boomboompower boomboompower added in progress This feature is actively being worked on pending action needs testing A new feature has not been tested and removed pending action labels Mar 6, 2020
@boomboompower boomboompower changed the title Remove skins from cache after x amount of time Provide automatic Skin and Cape caching Mar 25, 2020
@boomboompower
Copy link
Owner Author

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.

boomboompower added a commit that referenced this issue Mar 28, 2020
Selections in the PlayerSelectMenu will now respect their appropriate buffer type
Upgraded all old Gson calls to use the new JsonParser.parseString method since the old one is deprecated
Also worked a bit more on the CacheRetriever so it does not try upgrade Optifine's cape url since it does not support HTTPS
WebsiteUtils has also been deprecated and will be removed in a future release. With this, I'll start working on integrating a new updater system which I'd like to integrate into the SkinChanger UI, this means more mockups!
boomboompower added a commit that referenced this issue Dec 26, 2020
This release includes a new bleeding edge cache system (currently a bit less reliable than the previous version).
It also includes an implementation of Apagoge to support GitHub releases (the mod will now tell you when there is an update).

I've fixed the issue with the "old buttons" text not being translated, and added two new configurable options as well
1. To disable the updater if you don't want it
2. To disable the cache clearing itself on startup

More files were moved around in this release. This is likely the final move for them.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in progress This feature is actively being worked on needs testing A new feature has not been tested
Projects
None yet
Development

No branches or pull requests

1 participant