You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wetrockpolice.com relies on the free tier of the Mesowest API for precipitation observations. Each time a user visits wetrockpolice, we make a call to the Mesowest API for these observations then use javascript to parse out intervals.
Over the last 4 years, the site has organically grown from roughly ~3,000 page views per month during busy season to over 10,000 page views per month today with March 2023 alone generating 20,000 page views.
While this is great news, it does highlight a need to scale the weather API usage before the site is throttled and forced to pay for an enterprise tier.
Implementation
We do know that precipitation observations are generally only updated every 30m or hourly, depending on the weather station being requested. The way I see it we can implement a short term solution followed up by a long term solution
Short Term
Instead of requesting the weather API directly, we can proxy the call behind a WRP api view and apply a micro-cache of 5-10 minutes through a redis instance (which we do have available). This API call can simply forward the data back to the FE.
Long Term
As an improvement of using a micro cache and proxy API, we could configure a cron job that periodically pulls and parses rain interval information to be stored under a new persistence model. This model would represent the result of the parsing and contain easily referenceable information like the last seen rain interval, etc...
The text was updated successfully, but these errors were encountered:
Background
Wetrockpolice.com relies on the free tier of the Mesowest API for precipitation observations. Each time a user visits wetrockpolice, we make a call to the Mesowest API for these observations then use javascript to parse out intervals.
Over the last 4 years, the site has organically grown from roughly ~3,000 page views per month during busy season to over 10,000 page views per month today with March 2023 alone generating 20,000 page views.
While this is great news, it does highlight a need to scale the weather API usage before the site is throttled and forced to pay for an enterprise tier.
Implementation
We do know that precipitation observations are generally only updated every 30m or hourly, depending on the weather station being requested. The way I see it we can implement a short term solution followed up by a long term solution
Short Term
Instead of requesting the weather API directly, we can proxy the call behind a WRP api view and apply a micro-cache of 5-10 minutes through a redis instance (which we do have available). This API call can simply forward the data back to the FE.
Long Term
As an improvement of using a micro cache and proxy API, we could configure a cron job that periodically pulls and parses rain interval information to be stored under a new persistence model. This model would represent the result of the parsing and contain easily referenceable information like the last seen rain interval, etc...
The text was updated successfully, but these errors were encountered: