Cache the results on a time period so they decay out. Just keep a list (use DETS? data loss doesn't matter) {userId, [broccoli: 1, beef :10, bar: 10]} etc, when an ingredient is used it's incremented, if the ingredient isn't used for a while or gets bumped down in rank it gets dropped.
Functionality should be generic so we can do the same for nutrition for meal tracking.
Might be good to have functionality to hydrate. Restoring state should be easy, just grab the top X ingredients from a user's recipes. That would probably be a good initial implementation too.
Cache the results on a time period so they decay out. Just keep a list (use DETS? data loss doesn't matter) {userId, [broccoli: 1, beef :10, bar: 10]} etc, when an ingredient is used it's incremented, if the ingredient isn't used for a while or gets bumped down in rank it gets dropped.
Functionality should be generic so we can do the same for nutrition for meal tracking.
Might be good to have functionality to hydrate. Restoring state should be easy, just grab the top X ingredients from a user's recipes. That would probably be a good initial implementation too.