Cache /robots.txt at the HTTP level because it rarely changes but it gets requested by bots relatively frequently.
8 lines
164 B
Ruby
8 lines
164 B
Ruby
class RobotsController < ApplicationController
|
|
respond_to :text
|
|
|
|
def index
|
|
expires_in 1.hour, public: true unless response.cache_control.present?
|
|
end
|
|
end
|