Open Rotzbua opened 1 year ago
The API does not compress the (json) response. This leads to high traffic and increased loading times.
Statistics URL: https://w3champions.com/OverallStatistics/
API Requests:
https://website-backend.w3champions.com/api/w3c-stats/map-race-wins
https://website-backend.w3champions.com/api/w3c-stats/games-per-day
Source test result: https://pagespeed.web.dev/analysis/https-w3champions-com-OverallStatistics/7jpdz9z2je?form_factor=mobile
A) Enable compression at the proxy
https://github.com/w3champions/website/blob/76c877ee9247bb39a20882469c8db470f2331714/docker-compose.token.yml#L23-L26
Remove compression by frontend container: https://github.com/w3champions/website/blob/master/gzip.conf
B) Use Cloudflare (uses compression by default)
https://developer.chrome.com/docs/lighthouse/performance/uses-text-compression/
Problem
The API does not compress the (json) response. This leads to high traffic and increased loading times.
Example
Statistics URL: https://w3champions.com/OverallStatistics/
API Requests:
https://website-backend.w3champions.com/api/w3c-stats/map-race-wins
https://website-backend.w3champions.com/api/w3c-stats/games-per-day
Source test result: https://pagespeed.web.dev/analysis/https-w3champions-com-OverallStatistics/7jpdz9z2je?form_factor=mobile
Possible solution
A) Enable compression at the proxy
https://github.com/w3champions/website/blob/76c877ee9247bb39a20882469c8db470f2331714/docker-compose.token.yml#L23-L26
Remove compression by frontend container: https://github.com/w3champions/website/blob/master/gzip.conf
B) Use Cloudflare (uses compression by default)
Reference
https://developer.chrome.com/docs/lighthouse/performance/uses-text-compression/