if ($mosConfig_offline == 1) - is our site not planning to be offline? We kill, we save nothing.if (file_exists( $mosConfig_absolute_path .'/components/com_sef/sef.php' )) - don't you really know if a file exists on your site? We decide on which branch of the condition we need and delete the rest. Savings - the time it takes to execute a single file_exists each time a page is displayed.$menu = new mosMenu( $database ); - very often the composition of the menu within the site does not change. If so, then we kill the request call and the $ menu variable is assigned what should work (you can see print_r).frontend login & logout controls - has anyone ever seen javascript inside it? Kill and his company.$cur_template = $mainframe->getTemplate(); - Do you have different templates on each page? I usually have one, so I do $cur_template = ' '; - save one request to the database.// display the offline alert if an admin is logged in - is it a // display the offline alert if an admin is logged in or nothing? Also removed.// loads template file - we know that our template exists, why do we need an extra check of file_exists?Source: https://habr.com/ru/post/25598/
All Articles