Skip to content

Commit e2bffa1

Browse files
Serve static asset from an API Gateway endpoint (#1167)
* Update reports URLs to point to the 'static' endpoint on the development gateway * Update reports URLs to point to the 'static' endpoint on the development gateway * Update URLs to point to the production endpoint
1 parent afd557a commit e2bffa1

File tree

10 files changed

+46
-34
lines changed

10 files changed

+46
-34
lines changed

config/last_updated.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
},
112112
"/static/js/histogram.js": {
113113
"date_published": "2018-05-08T00:00:00.000Z",
114-
"date_modified": "2025-06-02T00:00:00.000Z",
115-
"hash": "58efe705af1fb94fe47af02ffa19fa95"
114+
"date_modified": "2025-12-07T00:00:00.000Z",
115+
"hash": "762edb2f242b0c9275f64963596288a7"
116116
},
117117
"/static/js/index.js": {
118118
"date_published": "2018-05-08T00:00:00.000Z",
@@ -166,23 +166,23 @@
166166
},
167167
"/static/js/techreport.js": {
168168
"date_published": "2023-10-09T00:00:00.000Z",
169-
"date_modified": "2025-10-16T00:00:00.000Z",
170-
"hash": "0621955a4fd4c1b61e59d19b4efcb38c"
169+
"date_modified": "2025-12-07T00:00:00.000Z",
170+
"hash": "f1d524a0c3936491e48e422013548e03"
171171
},
172172
"/static/js/techreport/section.js": {
173173
"date_published": "2023-10-09T00:00:00.000Z",
174-
"date_modified": "2025-08-18T00:00:00.000Z",
175-
"hash": "1775005cbf8d70f6fc4974781b7e1b51"
174+
"date_modified": "2025-12-07T00:00:00.000Z",
175+
"hash": "ccd53f137a4aa746f70dd6c90428db3b"
176176
},
177177
"/static/js/techreport/timeseries.js": {
178178
"date_published": "2023-10-09T00:00:00.000Z",
179-
"date_modified": "2025-10-15T00:00:00.000Z",
180-
"hash": "66106fc8e5a8ae322d813311e6366657"
179+
"date_modified": "2025-12-07T00:00:00.000Z",
180+
"hash": "fffa299ba030c83dbac35f5f81703ce5"
181181
},
182182
"/static/js/timeseries.js": {
183183
"date_published": "2018-05-08T00:00:00.000Z",
184-
"date_modified": "2025-06-05T00:00:00.000Z",
185-
"hash": "88e02e130b048bdbc7797a3c5c369d6d"
184+
"date_modified": "2025-12-07T00:00:00.000Z",
185+
"hash": "626181398990a64da615b1ab1e5737d3"
186186
},
187187
"/static/js/web-vitals.js": {
188188
"date_published": "2022-01-03T00:00:00.000Z",

package-lock.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/csp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"spdcrv.global.ssl.fastly.net",
1111
"lux.speedcurve.com",
1212
"'unsafe-inline'",
13+
"reports-dev-2vzgiib6.uc.gateway.dev",
14+
"reports-prod-2vzgiib6.uc.gateway.dev",
1315
],
1416
"font-src": ["'self'"],
1517
"connect-src": [

src/js/components/drilldownHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function setTitle(title) {
88

99
function setIcon(icon) {
1010
const img = document.querySelector('h1 .title-img');
11-
const imgUrl = `https://cdn.httparchive.org/static/icons/${icon}`;
11+
const imgUrl = `https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/icons/${icon}`;
1212
img.setAttribute('style', `background-image: url(${imgUrl})`);
1313
}
1414

src/js/histogram.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const [COLOR_DESKTOP, COLOR_MOBILE, COLOR_DESKTOP_ALT, COLOR_MOBILE_ALT] = Color
1111
function histogram(metric, date, options) {
1212
options.date = date;
1313
options.metric = metric;
14-
const dataUrl = `https://cdn.httparchive.org/reports/${options.lens ? `${options.lens.id}/` : ''}${date}/${metric}.json`;
14+
const dataUrl = `https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${options.lens ? `${options.lens.id}/` : ''}${date}/${metric}.json`;
1515
fetch(dataUrl)
1616
.then(response => {
1717
if (!response.ok) {

src/js/techreport/combobox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ComboBox {
3131
option.id = `${this.element.dataset.id}-${row.technology.replaceAll(' ','-')}`;
3232
const logo = document.createElement('img');
3333
logo.setAttribute('alt', '');
34-
logo.setAttribute('src', `https://cdn.httparchive.org/static/icons/${icon}`);
34+
logo.setAttribute('src', `https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/icons/${icon}`);
3535
logo.setAttribute('loading', 'lazy');
3636
option.append(logo);
3737
if(this.selected.includes(row.technology)) {
@@ -200,7 +200,7 @@ class ComboBox {
200200

201201
/* Add the app logo */
202202
const appIcon = document.createElement('img');
203-
appIcon.setAttribute('src', `https://cdn.httparchive.org/static/icons/${encodeURI(icon)}`);
203+
appIcon.setAttribute('src', `https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/icons/${encodeURI(icon)}`);
204204
appIcon.setAttribute('alt', '');
205205
appIcon.classList.add('logo');
206206
deleteSelection.append(appIcon);

src/js/techreport/tableLinked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class TableLinked {
107107
wrapper.classList.add('app-wrapper');
108108

109109
const img = document.createElement('span');
110-
const imgUrl = `https://cdn.httparchive.org/static/icons/${encodeURI(technology[0]?.icon)}`;
110+
const imgUrl = `https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/icons/${encodeURI(technology[0]?.icon)}`;
111111
img.setAttribute('aria-hidden', 'true');
112112
img.setAttribute('style', `background-image: url(${imgUrl})`);
113113
img.classList.add('app-img');

src/js/timeseries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { el, prettyDate, chartExportOptions, drawMetricSummary, callOnceWhenVisi
88

99

1010
function timeseries(metric, options, start, end) {
11-
const dataUrl = `https://cdn.httparchive.org/reports/${options.lens ? `${options.lens.id}/` : ''}${metric}.json`;
11+
const dataUrl = `https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${options.lens ? `${options.lens.id}/` : ''}${metric}.json`;
1212
options.chartId = `${metric}-chart`;
1313
options.tableId = `${metric}-table`;
1414
options.metric = metric;

templates/report/report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% block head %}
1616
{{ super() }}
1717
<link rel="stylesheet" href="{{ get_versioned_filename('/static/css/report.css') }}" />
18-
<link rel="preconnect" href="https://cdn.httparchive.org" />
18+
<link rel="preconnect" href="https://reports-prod-2vzgiib6.uc.gateway.dev" />
1919
<link rel="canonical" href="https://httparchive.org{{ request.path }}" />
2020
{% endblock %}
2121

tools/scripts/test_reports.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ LENSES="drupal magento wordpress top1k top10k top100k top1m"
2222
# These dated report URLs are tested for 200 status
2323
# We test the first and last report for each lens
2424
REPORT_MONTHLY_URLS=$(cat <<-END
25-
https://cdn.httparchive.org/reports/${REPORT_DATE}/bootupJs.json
26-
https://cdn.httparchive.org/reports/${REPORT_DATE}/tcp.json
27-
https://cdn.httparchive.org/reports/${CRUX_REPORT_DATE}/cruxCls.json
28-
https://cdn.httparchive.org/reports/${CRUX_REPORT_DATE}/cruxOl.json
25+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${REPORT_DATE}/bootupJs.json
26+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${REPORT_DATE}/tcp.json
27+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${CRUX_REPORT_DATE}/cruxCls.json
28+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${CRUX_REPORT_DATE}/cruxOl.json
2929
END
3030
)
3131

3232
for LENS in ${LENSES}
3333
do
3434
REPORT_MONTHLY_URLS_LENS=$(cat <<-END
35-
https://cdn.httparchive.org/reports/${LENS}/${REPORT_DATE}/bootupJs.json
36-
https://cdn.httparchive.org/reports/${LENS}/${REPORT_DATE}/tcp.json
37-
https://cdn.httparchive.org/reports/${LENS}/${CRUX_REPORT_DATE}/cruxCls.json
38-
https://cdn.httparchive.org/reports/${LENS}/${CRUX_REPORT_DATE}/cruxOl.json
35+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/${REPORT_DATE}/bootupJs.json
36+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/${REPORT_DATE}/tcp.json
37+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/${CRUX_REPORT_DATE}/cruxCls.json
38+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/${CRUX_REPORT_DATE}/cruxOl.json
3939
END
4040
)
4141
REPORT_MONTHLY_URLS="${REPORT_MONTHLY_URLS} ${REPORT_MONTHLY_URLS_LENS}"
@@ -45,16 +45,16 @@ done
4545
# These timeseries URLs are tested if the date exists in the returned body
4646
# We test the first and last report for each lens
4747
TIMESERIES_URLS=$(cat <<-END
48-
https://cdn.httparchive.org/reports/numUrls.json
49-
https://cdn.httparchive.org/reports/a11yButtonName.json
48+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/numUrls.json
49+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/a11yButtonName.json
5050
END
5151
)
5252

5353
for LENS in ${LENSES}
5454
do
5555
TIMESERIES_URLS_LENS=$(cat <<-END
56-
https://cdn.httparchive.org/reports/${LENS}/numUrls.json
57-
https://cdn.httparchive.org/reports/${LENS}/a11yButtonName.json
56+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/numUrls.json
57+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/a11yButtonName.json
5858
END
5959
)
6060
TIMESERIES_URLS="${TIMESERIES_URLS} ${TIMESERIES_URLS_LENS}"
@@ -64,16 +64,16 @@ done
6464
# For CrUX we always test the month before (unless an explicit date was passed)
6565
# We test the first and last report
6666
CRUX_TIMESERIES_URLS=$(cat <<-END
67-
https://cdn.httparchive.org/reports/cruxFastDcl.json
68-
https://cdn.httparchive.org/reports/cruxSmallCls.json
67+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/cruxFastDcl.json
68+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/cruxSmallCls.json
6969
END
7070
)
7171

7272
for LENS in ${LENSES}
7373
do
7474
CRUX_TIMESERIES_URLS_LENS=$(cat <<-END
75-
https://cdn.httparchive.org/reports/${LENS}/cruxFastDcl.json
76-
https://cdn.httparchive.org/reports/${LENS}/cruxSmallCls.json
75+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/cruxFastDcl.json
76+
https://reports-prod-2vzgiib6.uc.gateway.dev/v1/static/reports/${LENS}/cruxSmallCls.json
7777
END
7878
)
7979
CRUX_TIMESERIES_URLS="${CRUX_TIMESERIES_URLS} ${CRUX_TIMESERIES_URLS_LENS}"

0 commit comments

Comments
 (0)