mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
PERF: avoid preloading json in cases where it is not needed
(uploads / avatars / non GET requests)
This commit is contained in:
@@ -168,6 +168,10 @@ class ApplicationController < ActionController::Base
|
||||
# We don't preload JSON on xhr or JSON request
|
||||
return if request.xhr? || request.format.json?
|
||||
|
||||
# if we are posting in makes no sense to preload
|
||||
return if request.method != "GET"
|
||||
|
||||
# TODO should not be invoked on redirection so this should be further deferred
|
||||
preload_anonymous_data
|
||||
|
||||
if current_user
|
||||
|
||||
Reference in New Issue
Block a user