Reduce Met.no updates to every 6 hours
The forecast is only updated once per hour in the Nordic countries (minus Iceland), and every 6th hour in the rest of the world. More frequent requests than this is just a waste of bandwidth.
Note that the cache expiry header is set for a 30 minutes lifetime, so relying solely on a local cache will not be enough.
For example:
$ wget -S "https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=45.7333;lon=5.0833"
Date: Mon, 11 Jan 2021 14:32:59 GMT
Expires: Mon, 11 Jan 2021 15:03:22 GMT
Last-Modified: Mon, 11 Jan 2021 14:32:56 GMT
If we use a normal cache, we won't get a cache hit, because the expiry date is too recent.
The results contain interesting information though:
<model name="met_public_forecast" termin="2021-01-11T13:00:00Z" runended="2021-01-11T13:19:18Z" nextrun="2021-01-11T19:24:41Z" from="2021-01-11T14:00:00Z" to="2021-01-20T18:00:00Z"/>
Which should mean that we shouldn't try to get data from the website before 2021-01-11T19:24:41Z
, but we might need to take the time the run takes into account.