-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add page view caching #186
Conversation
@@ -223,3 +223,5 @@ | |||
# something more human-readable. | |||
# release="myapp@1.0.0", | |||
) | |||
|
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.
Is this localhost url on line 227 valid in the cluster this is hosted on?
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.
Probably doesn't matter as thats just the default if it can't find the env var.
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.
Yeah just the default for tests and things, I will set the env where I deploy it
|
||
ids = utils.get_unique_page_seen_ids(self.org, msisdn) | ||
self.assertEqual(ids, [164, 165, 166]) | ||
ids = utils.get_unique_page_seen_ids(self.org, msisdn) |
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.
We are repeating the assert here
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.
Yes, calling twice to make sure the second time round the values comes from the cache and it's not doing another call to contentrepo and the results are still the same
/orderedcontent/
gets called multiple times per contact for figuring out what content to send.get_unique_page_seen_ids
does a call to the contentrepo that take 5-8 seconds to complete and we tried adding a index but there is nothing else we can do to improve the performance.We're now caching the results for 5 hours and returning it to rapidpro where we will replace another page view call.