Skip to content

Commit e751cb2

Browse files
Purge CDN cache for / and index page (elastic#157)
With this commit we purge the CDN cache for the page root (i.e. the path `/`) as well as `/index.html`. Web browsers usually don't retrieve `index.html` but rather page root and thus we need to purge the cache for both to ensure users get a fresh copy.
1 parent 8e1bbde commit e751cb2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

external/pages/deploy.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set -e
55

66
BUCKET_NAME="elasticsearch-benchmarks.elastic.co"
77
S3_ROOT_BUCKET="s3://${BUCKET_NAME}"
8-
INDEX_PAGE_URL="https://${BUCKET_NAME}/index.html"
8+
INDEX_PAGE_URL="https://${BUCKET_NAME}/"
9+
FULL_INDEX_PAGE_URL="${INDEX_PAGE_URL}index.html"
910

1011
# see http://stackoverflow.com/a/246128
1112
SOURCE="${BASH_SOURCE[0]}"
@@ -51,4 +52,14 @@ sleep 5
5152
echo "Purging CDN cache for [${INDEX_PAGE_URL}]."
5253
# The page is served via Fastly. Details on how to wipe away caches in:
5354
# https://github.com/elastic/infra/issues/10695#issuecomment-521103380
55+
#
56+
# See also Fastly's docs:
57+
#
58+
# * How to purge the cache: https://docs.fastly.com/api/purge
59+
# * How to debug caching: https://docs.fastly.com/en/guides/checking-cache#using-curl
60+
#
61+
# Drop both - actually the page is located in index.html but web servers
62+
# will serve that page by default if "/" is hit.
5463
curl -XPURGE ${INDEX_PAGE_URL}
64+
echo "Purging CDN cache for [${FULL_INDEX_PAGE_URL}]."
65+
curl -XPURGE ${FULL_INDEX_PAGE_URL}

0 commit comments

Comments
 (0)