[Project Enhancement] - Weather/Location Data Caching
Created by: tayjaybabee
Is your feature request related to a problem? Please describe. In an effort to cut down on resource usage for both us and the API providers we use (no, this is not really an issue but it's smart to be aware and courteous with these types of things) we should be caching things like location data, and weather data.
Describe the solution you'd like When a user queries the weather using either stored location data or not it should check if the user had already asked within the past 10 minutes. If so, it will deliver the same info it delivered last time (which it saved in a temp file along with a timestamp) along with an indicator that this information is cached, and a time when cache expires.
We should also provide a --force or -f flag to force an override of the cache. This may also make it necessary to create a way for admins to manage the cache.
Additional context
[23:44:25] <Taylor> !weather 48186
[23:44:26] <Eve> Weather: Current Weather: Clear | Temp: 49.66 °F (9.9 °C) - Feels like: 46.2 °F (7.9 °C) | Humidity: 56.00% | Wind: 8.39 MPH (13.5 KPH) - Bearing: 335 (NNW)
(4 minutes later)
[23:48:26] <Taylor> !weather 48186
[23:48:27] <Eve> [Cached] [6m00s Remaining]: Clear | Temp: 49.66 °F (9.9 °C) - Feels like: 46.2 °F (7.9 °C) | Humidity: 56.00% | Wind: 8.39 MPH (13.5 KPH) - Bearing: 335 (NNW)
[23:48:35] <Taylor> oh ffs
[23:48:48] <Taylor> !weather --force 48186
[23:48:58] <Eve> Releasing cache for 48186
[23:49:01] <Eve> Weather: Current Weather: Clear | Temp: 61.5 °F (16.4 °C) - Feels like: 61.5 °F (16.4 °C) | Humidity: 64.00% | Wind: 9.13 MPH (14.7 KPH) - Bearing: 193 (SSW)