VarunAgw Posted January 27, 2021 Posted January 27, 2021 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.
DawPi Posted January 27, 2021 Posted January 27, 2021 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; }
VarunAgw Posted January 27, 2021 Author Posted January 27, 2021 @DawPi I am talking about this statement $rootPath = \IPS\Http\Url::external( \IPS\Settings::i()->base_url )->data['path'];
bfarber Posted January 27, 2021 Posted January 27, 2021 Thanks for reporting your findings - we'll take a look at the suggested change. 🙂 Ibai 1
Recommended Posts