Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 27, 20214 yr In ips/system/Output/Output.php::buildMetaTags() There is this statement $rootPath = \IPS\Http\Url::external( \IPS\Settings::i()->base_url )->data['path']; which is executing for every row in \IPS\Db::i()->select( '*', 'core_seo_meta' ) Turns out, we have 8000+ rows in core_seo_meta rows in database, so this statement executes 8000 times, causing ~300ms delay in response It would be better if the statement is moved out of forloop and executed only once.
January 27, 20214 yr Nope. In first it's trying get meta seo data from datastore... if ( isset( \IPS\Data\Store::i()->metaTags ) ) { $rows = \IPS\Data\Store::i()->metaTags; } else { $rows = iterator_to_array( \IPS\Db::i()->select( '*', 'core_seo_meta' ) ); \IPS\Data\Store::i()->metaTags = $rows; }
January 27, 20214 yr Author @DawPi I am talking about this statement $rootPath = \IPS\Http\Url::external( \IPS\Settings::i()->base_url )->data['path'];
January 27, 20214 yr Thanks for reporting your findings - we'll take a look at the suggested change. 🙂