PERF 🐎 Don't calculate preload data for non-xhr json requests

This will help out anyone querying as API instead of through a
browser.
This commit is contained in:
riking 2015-01-23 21:03:44 -08:00
parent c2e716cd88
commit fb72e2665f
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class ApplicationController < ActionController::Base
# If we are rendering HTML, preload the session data
def preload_json
# We don't preload JSON on xhr or JSON request
return if request.xhr?
return if request.xhr? || request.format.json?
preload_anonymous_data