Notice the commented out @cache.cached(timeout=300) on line 2. I tried that and it works but then the issue is that it caches it for the first user_id that was provided and returns wrong results for any subsequent user_id until the cache expires and then the issue starts all over again with the first user_id provided after the cache expires.
I want to do this where each user_id gets its own cache of results. Any tips on how?
The instagram api is notoriously strict on rate limits (seemingly random too) so if I don't start caching results to reduce queries, my client will probably get banned soon.
Here's the flask route/functionality:
Notice the commented out
@cache.cached(timeout=300)
on line 2. I tried that and it works but then the issue is that it caches it for the first user_id that was provided and returns wrong results for any subsequent user_id until the cache expires and then the issue starts all over again with the first user_id provided after the cache expires.I want to do this where each user_id gets its own cache of results. Any tips on how?
The instagram api is notoriously strict on rate limits (seemingly random too) so if I don't start caching results to reduce queries, my client will probably get banned soon.