Open mauzel opened 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..
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:
*.granbluefantasy.jp/*?t=*
.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.
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.