Pirate-Weather/pirateweather

Missing Dark Sky response headers

Closed this issue · 2 comments

Describe the issue

As noted in #315 there are a few response headers that are missing from Pirate Weather. I know you're striving for compatibility with Dark Sky so maybe these could be added?

Two of the headers should be fairly straightforward to add as X-Response-Time is just the existing processTime data point and X-Forecast-API-Calls is just ratelimit-limit minus ratelimit-remaining. The Cache-Control header is more tricky since nothing is cached at the moment. Doing a quick search maybe it would be best to set it to no-cache but not an expert in this kind of stuff.

Acknowledgements

  • I have searched this repository and Home Assistant Repository to see if the issue has already been reported.
  • I have read through the API documentation before opening this issue.
  • I have not included my API key anywhere in my issue.
  • I have written an informative title.

Was going to revise the docs... but this looked more interesting, so I got distracted. All three of those headers have been added in though, and should be live in production. For Cache-Control, I defined it as 15 minutes, since that's the temporal resolution of HRRR Subhourly. There still isn't any server side caching, but this should let clients know what to expect

I see all three on the development sever but only X-Forecast-API-Calls on live currently.