PERF: Rendering crawler's template is expensive.

This commit is contained in:
Guo Xiang Tan
2016-04-07 22:28:31 +08:00
committed by Régis Hanol
parent 3d4cdd7040
commit 4e7e4cee7d
3 changed files with 26 additions and 18 deletions

View File

@ -169,8 +169,12 @@ module ApplicationHelper
MobileDetection.resolve_mobile_view!(request.user_agent,params,session)
end
def crawler_layout?
controller.try(:use_crawler_layout?)
end
def include_crawler_content?
controller.try(:use_crawler_layout?) || !mobile_view?
crawler_layout? || !mobile_view?
end
def mobile_device?