From b4dfb84f37ace5446353164477f6f7a542dc83e6 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 17 Aug 2016 10:04:23 +1000 Subject: [PATCH] PERF: stop doing work for HEAD requests on topics --- app/controllers/topics_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index 90f883f9646..acae3c2af9b 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -620,6 +620,12 @@ class TopicsController < ApplicationController end def perform_show_response + + if request.head? + head :ok + return + end + topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false, include_raw: !!params[:include_raw]) respond_to do |format|