diff --git a/api/comments.go b/api/comments.go index a61e41f..3243b94 100644 --- a/api/comments.go +++ b/api/comments.go @@ -9,6 +9,7 @@ import ( "codeberg.org/rimgo/rimgo/utils" "github.com/dustin/go-humanize" "github.com/microcosm-cc/bluemonday" + "github.com/patrickmn/go-cache" "github.com/tidwall/gjson" "gitlab.com/golang-commonmark/linkify" ) @@ -55,6 +56,7 @@ func (client *Client) FetchComments(galleryID string) ([]Comment, error) { ) wg.Wait() + client.Cache.Set(galleryID+"-comments", comments, cache.DefaultExpiration) return comments, nil }