thegreenwebfoundation / greencheck-api

The green web foundation API
https://www.thegreenwebfoundation.org/
Apache License 2.0
9 stars 3 forks source link

Lets use redis results to return early in the api pipeline if we have a result #34

Closed arendjantetteroo closed 4 years ago

arendjantetteroo commented 4 years ago

As we already store the results in redis for each domain, we can just return that result early in the api pipeline. If we do, we can remove the $needsReply from rabbitmq and put that in as a low priority request. Hopefully this saves a lot of rabbitmq channels.

Another optimisation later on might be to put/check the time the last request was checked and only do an update if more than x hours ago. If we still care about the logging we could even fire a log request without a check request and just log the same result as we had from cache.

lets first try this.

mrchrisadams commented 4 years ago

Okay, I think I follow this. Looks good to me.