-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Caching on heavily-used API calls: srch/api/profiles #4763
Conversation
Generated by 🚫 Danger |
Great. I'll roll this out today and we can see how it does! |
Strangely i don't see a lot of tracking in Skylight: https://oss.skylight.io/app/applications/GZDPChmcfm1Q/recent/6h/endpoints/Srch::Search%20%5BGET%5D%20srch%2Fprofiles Not sure if this is because these calls aren't monitored? |
Depending on how it does we can implement the caching for the other endpoints... |
https://publiclab.org/api/srch/profiles?query=jywa&sort_by=recent&field=username&_=1549385453136 is about 1.9 seconds right now. |
Wow, ok so i did a hard cache flush and reloaded this: https://publiclab.org/api/srch/profiles?query=camila&sort_by=recent&field=username&_=1549385453136 Initially 6 seconds, but on repeating, 578ms https://publiclab.org/api/srch/profiles?query=sidha&sort_by=recent&field=username 2 seconds, then on refresh 553 ms https://publiclab.org/api/srch/profiles?query=jywa&sort_by=recent&field=username 2 seconds then 80 ms so, i think this worked pretty well. Let me try actually using it in a comment... |
And a longer interactive session here: You can see how typing This is a big improvement, but I do want to note how many requests go out -- i think we can change the settings on the typeahead to refine this too. See a gif: Also note it's sending lots of requests where |
Copying this into #4670 |
* cache * fixing gemfile
Fixes #3149