netromdk / slacker

Slacker - Easy access to the Slack API and admin of workspaces/teams.
MIT License
14 stars 0 forks source link

Introduce caching #105

Closed netromdk closed 5 years ago

netromdk commented 6 years ago

We might want to introduce caching of the values returned in SlackAPI by using TTL, for instance. And only for certain things, like users, channels etc., but not the responses to destructive events, like deleting files. One way to do this is adding an extra ttl=None argument to SlackAPI.post so each command has to control it directly. Another way is to control all of it inside SlackAPI and employ caching depending on the Slack API method used.

This module looks really useful: https://cachetools.readthedocs.io/en/latest/

Another thing to think about is whether we want the cache saved to disk or not? To keep things simple the cache would only be in memory.