Skip to content

Commit 2a70ddc

Browse files
committed
Add conditional GET headers to feed response
1 parent 52e5d5a commit 2a70ddc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/controllers/feed_controller.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
class FeedController < ApplicationController
22
def index
33
@articles = ArticlePage.published
4-
respond_to do |format|
5-
format.html { redirect_to feed_path(format: :atom), status: :moved_permanently }
6-
format.atom
4+
5+
if stale?(@articles, public: true)
6+
respond_to do |format|
7+
format.html { redirect_to feed_path(format: :atom), status: :moved_permanently }
8+
format.atom
9+
end
710
end
811
end
912
end

0 commit comments

Comments
 (0)