FIX: remove slow platform detection from server side

Historically due to https://meta.discourse.org/t/why-is-discourse-so-slow-on-android/8823
we decreased page sizes of both home page and topic page on android by half.

This was done on the server side and as a side effect and caused page sizes on android
to mismatch between Android and non Android.

Unfortunately about a year ago googlebot started pretending it is Android,
this cause Google to start indexing pages as what android would see. So
it saw double the amount of pages in the index as what exists on desktop.
This in turn caused double the amount of indexing work and a large amount
of broken links on long topics.

This fix removes all special behavior which is no longer needed due to
other performance work in Discourse including raw handlebars on home page
and virtual dom on topic pages.

I tested we do not need this on Blu Advance 5.0 it has 1.3 GHZ mediatec mt6580
This phone retails for around $50 USD.

If we decide long term that we want any hacks like this we will shift them
to the client side. It can just hold data in memory without rendering.
This commit is contained in:
Sam
2018-12-13 13:56:49 +11:00
parent 92df7b212c
commit 94b8ba4f8f
7 changed files with 1 additions and 19 deletions

View File

@ -101,10 +101,6 @@ class ApplicationController < ActionController::Base
end
end
def slow_platform?
request.user_agent =~ /Android/
end
def set_layout
use_crawler_layout? ? 'crawler' : 'application'
end