Skip to content

Commit b0dbbcc

Browse files
authored
Add a cachebuster= argument to API requests (#1677)
This avoids over-aggressive caches: ```diff $ diff -u \ <(curl -fsSL 'https://www.php.net/releases/index.php?json&max=100&version=8' | jq 'keys_unsorted') \ <(curl -fsSL 'https://www.php.net/releases/index.php?json&max=100&version=8' -H 'accept-language: en-US,en;q=0.9' | jq 'keys_unsorted') --- /dev/fd/63 2026-07-30 14:37:22.845857517 -0700 +++ /dev/fd/62 2026-07-30 14:37:22.845857517 -0700 @@ -1,7 +1,11 @@ [ - "8.5.8", + "8.5.9", + "8.4.24", + "8.3.33", + "8.2.33", "8.4.23", "8.3.32", + "8.5.8", "8.2.32", "8.5.7", "8.4.22", @@ -94,9 +98,5 @@ "8.1.25", "8.2.12", "8.1.24", - "8.2.11", - "8.1.23", - "8.2.10", - "8.1.22", - "8.2.9" + "8.2.11" ] ```
1 parent c363893 commit b0dbbcc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

versions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ else
1414
fi
1515
versions=( "${versions[@]%/}" )
1616

17+
now="$(date --utc '+%s')"
18+
1719
for version in "${versions[@]}"; do
1820
rcVersion="${version%-rc}"
1921
export version rcVersion
@@ -45,6 +47,7 @@ for version in "${versions[@]}"; do
4547
]
4648
'
4749
fi
50+
apiUrl+="&cachebuster=$now" # combat over-aggressive cache on php.net
4851
IFS=$'\n'
4952
possibles=( $(
5053
curl -fsSL "$apiUrl" \

0 commit comments

Comments
 (0)