Fragment caching does not support an explicit expiration date for simplicitly, which means that cached resources are tied to the update datetime of the model. In this case unfortunately this is not sufficient: a cached time that potentially never gets expired can stale quickly when applied to a time sensitive item like a notification. Since the "time ago" computation is not particularly heavy and notifications are paginated, I ended up removing that part from the cache altogether. As a byproduct I created two new separate cache keys for the article notification, one of each section surrounding the time. |
||
|---|---|---|
| .. | ||
| shared | ||
| _aggregated_reactions.html.erb | ||
| _article.html.erb | ||
| _badgeachievement.html.erb | ||
| _broadcast.html.erb | ||
| _comment.html.erb | ||
| _follow.html.erb | ||
| _mention.html.erb | ||
| _milestone.html.erb | ||
| _notifications_list.html.erb | ||
| _reaction.html.erb | ||
| _tagadjustment.html.erb | ||
| index.html.erb | ||