mauzel / mproxy-gbf

GRANBLUE FANTASY CACHING PROXY
MIT License
4 stars 6 forks source link

Add automatic cache refresh/verification #15

Open mauzel opened 6 years ago

mauzel commented 6 years ago

The cache can get into a bad state or cached assets can get stale.

Let's remove the tediousness of manually fixing cache files and just have a worker thread or process which periodically refreshes and verifies the cache.

AkagiShiroe commented 6 years ago

a different multi-threaded handler? i was thinking about to load whole ".cache_list" to memory as temporary sources (also throw new cache here).. but talking was easy..

mauzel commented 6 years ago

I think your idea is similar to what I was thinking. My general idea is to load the .cache_list into memory and do the following:

So, I think this is the same as what you said. However, the reason to do this in a separate worker thread is implementation and performance. I want to keep the logic for the "cache refresh" separated from the proxy server code, and I also don't want to be refreshing the cache while the proxy is busy.

The cache directory gets quite large so I don't want a cache refresh, which could take a long time, to block the normal proxy operations.