diff --git a/app/labor/cache_buster.rb b/app/labor/cache_buster.rb index 7d9d8549c..72a76b0dd 100644 --- a/app/labor/cache_buster.rb +++ b/app/labor/cache_buster.rb @@ -50,9 +50,11 @@ class CacheBuster bust_tag_pages(article) bust("/api/articles/#{article.id}") bust("/api/articles/by_path?url=#{article.path}") - - article.collection&.articles&.find_each do |a| - bust(a.path) + if article.collection_id + article.collection&.articles&.find_each do |a| + bust(a.path) + end + Rails.cache.delete "views/article-series-collection-#{article.collection_id}" end end diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb index 7f3f8120d..ced032236 100644 --- a/app/views/articles/show.html.erb +++ b/app/views/articles/show.html.erb @@ -162,13 +162,17 @@ <% if @article.collection_id %> - <%= render "articles/collection", position: "top" %> + <% cache("article-series-collection-#{@article.collection_id}") do %> + <%= render "articles/collection", position: "top" %> + <% end %> <% end %>