Skip to content
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

Merged
merged 25 commits into from
May 21, 2018
Merged

Feature/request cache #3418

merged 25 commits into from
May 21, 2018

Conversation

pjosh
Copy link
Contributor

@pjosh pjosh commented May 17, 2018

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

@pjosh pjosh requested a review from edbrett May 17, 2018 10:11
Copy link
Contributor

@edbrett edbrett left a 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-

![gitflow workflow](https://www.atlassian.com/dam/jcr:b5259cce-6245-49f2-b89b-9871f9ee3fa4/03%20(2).svg)

#### Clear Redis cache
If you need to clear the Redis cache after deploy, run these commands on your local terminal:
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

@edbrett edbrett merged commit b020c0f into develop May 21, 2018
@edbrett edbrett deleted the feature/request-cache branch May 21, 2018 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants