Skip to content

[ENHANCEMENT] Add cache-control to API responses #1941

@rmarx

Description

@rmarx

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions