A very minimal CDN-style cache service implementation for holding config files (small UTF-8 plain text).
Originally designed for serving a copy of Squad game servers' remote admin/ban configs.
Always try origin first, and serve latest cached version in case origin is unreachable (as fallback).
- Python 3.11+
pip install flask requestsUsing a venv is recommended.
Within the top section of main.py
Test run:
python main.py
# GET http://localhost:56564/file/app_cfgThere's 2 prepended comment lines added for noticing origin server status and time:
// Synced {last_check_time} or // Origin Unreachable {last_check_time}, using last cached version
// Cached version fetched at {fetched_at}
You can change the prefix (like // -> #) by changing HEADER_PREFIX in config.
To remove them entirely, you need to modify _prepend_comment() by yourself.
pip install flask requests waitress Paste
# Run
waitress-serve --host=0.0.0.0 --port=<port> main:appGET /file/<key>-> return cached config file (try origin, fallback to cache if failed).GET /health-> returnsokfor api monitoring.
This project is licensed under the GNU Affero General Public License v3.0.