Respect HTTP Cache-Control header if available (#450)

Allow stale responses in case of error in order to reduce the number of temporary errors.

Note that the cache will be reset on the first build of every week in any cases, see .github/workflows/update.yml.
This commit is contained in:
Marc Wrobel
2025-06-28 12:57:41 +02:00
committed by GitHub
parent e288cb3e8f
commit 3beb0f6e34
3 changed files with 6 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ DATE_PATTERN = re.compile(r"\b\d+\s[A-Za-z]+\s\d+\b")
for config in endoflife.list_configs_from_argv():
with releasedata.ProductData(config.product) as product_data:
# URLs are cached to avoid rate limiting by support.apple.com.
soups = [BeautifulSoup(response.text, features="html5lib") for response in http.fetch_urls(URLS, cache=True)]
soups = [BeautifulSoup(response.text, features="html5lib") for response in http.fetch_urls(URLS)]
for soup in soups:
versions_table = soup.find(id="tableWraper")