2 tips to improve your xMenus performance:
note: THIS IS ONLY FOR SITES that are stable and not developing new menus.
#1 - combine xm_extra_style.css into cached css (remove individual css file load)
1. Bust out the css file,
xm_extra_style.css
This file is auto-generated by xMenus - essentially 3 css classes for each menu position.
It is an additional css file that is not integrated into css speed-up tool -- so if you are optimizing your site for performance, less individual css files are better than more. But css speedup tool solves that -- BUT because of how xMenus is designed, it does not send the small css to the speed-up tool (using load_defer)
1. Go to your page source for your home page (or wherever your xMenus load)
2. Find: "xm_extra_style.css"
3. Click on the link, that is probably something like:
http://www.domain.com/var/cache/xm_extra_style.css
4. COPY the contents of this file into a NEW file...
/skin/common_files/modules/TXS_XMenus/custom_css/xm_extra_style.css
set permissions as needed.
5. in file:
/skin/common_files/modules/TXS_XMenus/include_css.tpl
FIND
Code:
{if $xm_extra_css ne ''}
<link rel="stylesheet" type="text/css" href="{$xm_extra_css}" />
{/if}
comment it out.
Immediately below, insert:
Code:
{if $xm_extra_css ne ''}
{load_defer file="modules/TXS_XMenus/custom_css/xm_extra_style.css" type="css"}
{/if}
Now, xm_extra_style.css will load (cached) with all the other css.
IF YOU MAKE ANY CHANGES to your menu, you will need to disable this, grab the edited css, etc...
THIS IS ONLY FOR SITES that are stable and not developing new menus.
#2 - EMBEDDED IMAGES in menu "Offer Text"
This is a brilliant feature in xMenus -- BUT -- the images need to get sent to the CDN. I don't know if this is the BEST way, but it works.
IF you are embedding an image into the "offer text" -- instead of using an absolute path to the image (in the xMenus demo, they put the images in /images/XM/ -- and that's the problem -- this will not serve the images from your cdn)
INSTEAD -- make the path to your images a full path,
<img src="http://www.domain.com/images/XM/free_shipping_187x107.jpg" width="187" height="107" />
THEN - in file,
/skin/common_files/modules/TXS_XMenus/display_menu/menu.H.tpl
FIND:
Code:
{$xm_head->footer_text}
REPLACE WITH:
Code:
{$xm_head->footer_text|replace:'www.domain.com':'cdn.domain.com'}
(or whatever your cdn path is)
Bingo. Special offer images in the menus are now served from your CDN.
IF THERE IS A BETTER WAY TO DO THIS, please share!!!!