GoogleChrome / GoogleChrome/webstatus.dev
[ENHANCEMENT] Add cache-control to API responses
- Dominant language
- Go
- Stars
- 254
- Forks
- 62
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 64
Description
**Is your feature request related to a problem? Please describe.**
When utilising the webstatus.dev API (for example like this: https://api.webstatus.dev/v1/features?q=baseline_date%3A2018-01-01..2018-12-31) the response does not send any `cache-control` HTTP response headers, meaning the API request is always re-done on the network instead of being loaded from the (browser) cache. This can be bad for performance and data usage.
**Describe the solution you'd like**
I would like for the API responses to include an appropriate cache-control header (e.g., `cache-control: public, max-age=86400` or similar)
**Describe alternatives you've considered**
We could pull in the data via a cronjob on our backend and then serve the data from our local server, but that seems clunky compared to having the API do it itself? :)
**Additional context**
We are using the webstatus.dev API directly on the frontend for https://rumarchive.com/insights/
Contributor guide
Assessment
This issue has not been assessed yet.