You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if this gem provides any caching conventions. Similar to the example activity feed in the Readme, I have the general format of "Actor preformed action on Resource" for my activity feed items. I therefore need to cache against the Actor (a user) and the Resource. As far as I know, there's 2 ways to solve this.
Query the Actor and Resource before hitting the cache. This isn't very efficient and kind of destroys the point of using a memory store for an activity feed.
Add a cache key to the activity feed item, and manually bust it whenever the Actor or Resource is updated in an activity-feed-significant way.
2 seems like the obvious choice. Perhaps cache keys and bust methods should be a part of the gem?
The text was updated successfully, but these errors were encountered:
A third way to solve this is to expire based only on time. Expiring the activity feed cache every hour will keep it relatively up to date and avoid the vast majority of DB hits. The 2nd solution I proposed is not sensible unless the actor id, resource class and resource id can all be indexed in Redis.
Hello again :)
I'm wondering if this gem provides any caching conventions. Similar to the example activity feed in the Readme, I have the general format of "Actor preformed action on Resource" for my activity feed items. I therefore need to cache against the Actor (a user) and the Resource. As far as I know, there's 2 ways to solve this.
2 seems like the obvious choice. Perhaps cache keys and bust methods should be a part of the gem?
The text was updated successfully, but these errors were encountered: