
Fast Joomla - index.php file
In this topic, I would like to share some tips (note: sometimes they are completely inapplicable!) To speed up Joomla 1.0 (many tips apply to 1.5). Caching will not be considered, because at first I optimize everything as much as possible without it, and only then the caching methods.
So, let's start with index.php
1. Do you need https? Correctly, we kill 4 lines which check this business. Saved a couple of milliseconds.
2.
3. Mambots? For ordinary uncomplicated sites are rarely needed, agree? Although it happens, I’m doing something in the onStart trigger. Actually, the mambot call can also be removed if it is not needed. Another precious milliseconds.
4.
5.
6.
7.
8.
9.
If the topic is interesting, I can describe how to make a very fast template, optimize the operation of modules and delete something from the kernel.
Thanks for attention.
So, let's start with index.php
1. Do you need https? Correctly, we kill 4 lines which check this business. Saved a couple of milliseconds.
2.
if ($mosConfig_offline == 1)
- our site does not plan to be offline? We kill, we save nothing. 3. Mambots? For ordinary uncomplicated sites are rarely needed, agree? Although it happens, I’m doing something in the onStart trigger. Actually, the mambot call can also be removed if it is not needed. Another precious milliseconds.
4.
if (file_exists( $mosConfig_absolute_path .'/components/com_sef/sef.php' ))
- Do you really not know if a file exists on your site? We decide on which branch of the condition we need and delete the rest. Savings - the runtime of one file_exists each time the page is displayed. 5.
$menu = new mosMenu( $database );
- very often the composition of the menu within the site does not change. If so, then we kill the call of the request and assign to the variable $ menu what should turn out (you can print_r to see). 6.
frontend login & logout controls
- Has anyone ever seen javascript invoked inside it? We kill him for the company. 7.
$cur_template = $mainframe->getTemplate();
- Do you have different templates on each page? I usually have one, so I do $cur_template = 'имя шаблона';
- we save one request to the database. 8.
// display the offline alert if an admin is logged in
- Is it scared of something to do? Also removed. 9.
// loads template file
- we know that our template exists, why do we need an extra check for file_exists? If the topic is interesting, I can describe how to make a very fast template, optimize the operation of modules and delete something from the kernel.
Thanks for attention.