mirror of
https://github.com/MiSTer-devel/Distribution_MiSTer.git
synced 2026-05-17 03:03:37 +00:00
add no-cache headers and cache buster query parameter
This commit is contained in:
6
.github/download_distribution.py
vendored
6
.github/download_distribution.py
vendored
@@ -718,7 +718,8 @@ def is_valid_uri(x: str) -> bool:
|
||||
# network utilities
|
||||
|
||||
def fetch_text(url: str) -> str:
|
||||
return run_stdout(f'curl --fail --location --silent {url}')
|
||||
cache_bust = int(time.time_ns() / 1000)
|
||||
return run_stdout(f'curl -H "Cache-Control: no-cache, no-store" -H "Pragma: no-cache" --fail --location --silent {url}?_={cache_bust}')
|
||||
|
||||
def download_repository(path: str, url: str, branch: str) -> None:
|
||||
if Path(path).exists():
|
||||
@@ -729,8 +730,9 @@ def download_repository(path: str, url: str, branch: str) -> None:
|
||||
run(f'git -c protocol.version=2 clone -q --no-tags --no-recurse-submodules --depth=1 {minus_b} {url} {path}')
|
||||
|
||||
def download_file(url: str, target: str) -> None:
|
||||
cache_bust = int(time.time_ns() / 1000)
|
||||
Path(target).parent.mkdir(parents=True, exist_ok=True)
|
||||
run(f'curl --show-error --fail --location -o "{target}" "{url}"')
|
||||
run(f'curl -H "Cache-Control: no-cache, no-store" -H "Pragma: no-cache" --show-error --fail --location -o "{target}" "{url}?_={cache_bust}"')
|
||||
|
||||
# execution utilities
|
||||
|
||||
|
||||
Reference in New Issue
Block a user