diff --git a/api/user.go b/api/user.go index 77d5ef1..1531e96 100644 --- a/api/user.go +++ b/api/user.go @@ -103,6 +103,11 @@ func (client *Client) FetchSubmissions(username string, sort string, page string } func (client *Client) FetchUserComments(username string, page string) ([]Comment, error) { + cacheData, found := client.Cache.Get(username + "-usercomments-" + page) + if found { + return cacheData.([]Comment), nil + } + req, err := http.NewRequest("GET", "https://api.imgur.com/comment/v1/comments", nil) if err != nil { return []Comment{}, err