gw2-api / issues

Issue tracker for the Guild Wars 2 API
https://discord.gg/zqeHCEg
16 stars 0 forks source link

Cache-Control across API, preferably via `If-Modified-Since` request header #63

Open shehi opened 10 months ago

shehi commented 10 months ago

Feature Description

As hinted in API Wiki docs, it would be great if we could have some semblance of Cache-Control for entities that support last-modified timestamp. A 2/characters/:id request containing, e.g. If-Modified-Since: Mon, 27 Nov 2023 09:35:00 GMT for a character which is stale, returning 304 Not Modified with no data attached to the response payload would be much faster.

The goal for this feature request is to have much faster API, as some queries do indeed last for seconds. For a project where frequent player- and guild-data querying is mission critical, a latency of this magnitude become a cause of worry. Applications already do (at the very least should) cache the data they receive. Receiving the same data again seems unnecessary, especially API backend is potentially wasting good resources to get all those data. If applicable, upon existense of If-Modified-Since header in client requests, API should be checking whether the requested resource is stale or not, before fetching it. Sometimes that fetch is just a costly waste of time.

Implementation

No response

Example

No response

Anything else?

No response