In order to reduce the initial load time of page, it is recommended to move all the JS includes in the <head> section of web page to the footer. Lets see how we can do it in Magento.
Step 1: Add Layout Updates
Create a child block of “before_body_end” named “foot” similar to the head block in local.xml file as shown below:
<?xml version="1.0" ?> <layout version="0.1.0"> <default> <reference name="before_body_end"> <block type="page/html_head" name="foot" as="foot" after="-" template="page/html/foot.phtml"/> </reference> </default> </layout>
Magneto comes with a very useful debugging tool for developers called “Profiler”. It can be used to identify issues in your code making the website slow. The Magento “Profiler” reports the time taken by block of code under test to execute, the number of times the block of code executed and the memory used by it while rendering a Magento web page.
By default Magento Profiler is disabled, let see how to enable it.
How to enable “Profiler” in Magento?
To enable “Profiler” in Magento, you have to go through 2 parts:
Part A
1) Go to Admin >> System >> Configuration.
2) Under the “Advanced” tab, click the “Developer” link to open the developer section.
3) Now expand the “Debug” block and select “Yes” in the Profiler dropdown.
4) If you are debugging in a live environment then its better to restrict the profiler output display to the developers only so that customers browsing your website do not see any differences on the frontend. To do so expand the “Developer Client Restrictions” block and add the developer IPs comma separated in the text box provided.
5) Save the configuration.
Optimizing Table in database is just like the doing Disk Defragmentation in your PC.
Optimize Table should be used if you have deleted a large part of a table or if you have made many changes to a table with variable length rows, such as VARCHAR, TEXT, BLOB or VARBINARY columns. Deleted rows are maintained in the linked list and insert operations reuse the old row positions. You can use “Optimize Table” to reclaim unused space and defragment the data file for optimal performance. If a lot of changes have been made to a table, optimizing the table can sometimes significantly improve performance.
Magento maintains several log tables for tracking purpose like customer access, products viewed, products compared etc. These tables grow in size day by day so if you have a large numbers of visitors on your website the size of these log tables may become large enough within a week slowing down your database. So you should perform database log cleaning on a regular basis – daily/weekly/monthly depending upon your website traffic.
There are three ways to clean out these tables:
1. Log Cleaning in the Magento Admin
2. Shell Utility log.php in the ../shell directory, and
3. Manually via phpMyAdmin or mysql client