-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/request cache #3418
Feature/request cache #3418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing feature! Super amazing excellent well done 👏 🎖 🏇 🤓 🌵 . I would like to talk through the PR before merging on Monday as it is the weekend and I dont want to understand everything before it going to production.
@@ -95,6 +100,13 @@ We follow a [Gitflow Worklow](https://www.atlassian.com/git/tutorials/comparing- | |||
|
|||
.svg) | |||
|
|||
#### Clear Redis cache | |||
If you need to clear the Redis cache after deploy, run these commands on your local terminal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we automate this to happen on build? So when we deploy the cache is flushed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will not be possible 😭 😭 I've spent almost the whole day yesterday, trying to find a solution, but Heroku is a very hard bastard. I wanted to talk to someone expert in Heroku to see if he could come up with any solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that is very annoying. maybe @simaob can help?
Overview
This awesome feature prevents potencial issues when our external data sources fall.
Basically, we store the data source endpoints in a RedisDB. After that, we always try to get the information from Redis (much faster and reduces charge on the API).
The cache expires in 24h by default, but you can set other duration. Besides that, you can set cache exceptions if you need to cache the request but sometimes not.
Test
It's fully integrated in the country pages. If you don't have Redis on you machine, run this command:
brew install redis