felddy/foundryvtt-docker

Do not attempt to get download link when file exists in cache

ThiefMaster opened this issue · 1 comments

I'm hosting 6 foundry instances for some friends on my server. When updating them I usually update one and then copy the downloaded archive into the container-cache volume of the other instances. However, I run into rate limits nonetheless because even though the file exists it's attempted to get a download link and download something - the existing file is apparently only used for an if-modified-since check, but releases should not change anyway.

felddy commented

Thank you for your feature request, and for detailing the issue you're facing with rate limits when updating multiple Foundry instances.

Firstly, let's clarify the role of the "container cache." It serves as a cache, meaning if a required file is already present, the container will use it for installation. However, if you've configured the container with credentials or a URL for a release, it will still attempt to fetch a new version, leading to the rate-limiting issue you've experienced.

The good news is that you can bypass this behavior. To avoid hitting rate limits, you can simply not pass in any credentials or a release URL. Continue placing the .zip file into the container cache for each instance as you've been doing, and then restart the containers.

If your six instances share access to a filesystem, I recommend mounting the same container cache into each instance's /data directory. Configure just one of these instances with credentials. Then, perform a rolling restart, starting with the instance that has the credentials. This will update the cache, and the remaining instances will use the updated cache, avoiding unnecessary rate-limiting.

For a practical example of this setup, you can refer to the following discussion:

I'm going to close this issue for now, but if there are more requests or if the situation changes in the future, we can certainly revisit it. Feel free to continue the discussion here; I'm always open to new ideas and feedback.

Thanks again for your contribution to the project.