Jump to content

Featured Replies

Posted

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.

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;
			}

 

  • Author

@DawPi

I am talking about this statement 

$rootPath = \IPS\Http\Url::external( \IPS\Settings::i()->base_url )->data['path'];

Thanks for reporting your findings - we'll take a look at the suggested change. 🙂 

Recently Browsing 0

  • No registered users viewing this page.