Skip to content

Commit

Permalink
Add querystring param to cache-bust pages URL
Browse files Browse the repository at this point in the history
The nightly Lighthouse run pulls down a list of URLs to test from a
URL that is configured via a GitHub Secret. This secret value currently
points to a GitHub gist raw URL, e.g.

https://gist.githubusercontent.com/username/abcdef123456/raw/

Unfortunately, this URL doesn't always return the latest version of the
gist, apparently due to some caching on GitHub's side. To try to
bypass this caching, we can try to add a random querystring to the URLs
being fetched, e.g. ?12345678.
  • Loading branch information
chosak committed Dec 12, 2024
1 parent 9b97209 commit 35f57e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
- name: Optionally fetch list of cf.gov pages to test
env:
TEST_PAGES_URL: ${{ secrets.TEST_PAGES_URL }}
# Add a random date query string to the URL to cache-bust.
run: >
[[ -n "${TEST_PAGES_URL}" ]] && wget -O urls.txt "$TEST_PAGES_URL"
[[ -n "${TEST_PAGES_URL}" ]] && wget -O urls.txt "$TEST_PAGES_URL?$(date +%s)"
continue-on-error: true

- name: Run Lighthouse CLI against specified cf.gov pages
Expand Down

0 comments on commit 35f57e9

Please sign in to comment.