Mega menu causing mega-slowdown on C5 site

Permalink Browser Info Environment
I'm having trouble with mega-menu on a C5 site. The menu loads fine, displays fine, but appears to be slowing my site down.

When disabled, the TTFB is 2.1 sec; with MM enabled, it's +7 sec. Repeat views are not much better, with TTFB almost 3sec and almost 6 sec to fully loaded.

It appears part of the issue is with a 404 error on pie.php:
Request Headers:
GET /packages/jb_megamenu/blocks/jb_megamenu/js/PIE.php HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; PTST 2.342)
Host:http://www.**********.org
Connection: Keep-Alive
Cookie: CONCRETE5=51d91c3cde5c9ec4e297f7be4b8abd2f
Response Headers:
HTTP/1.1 404 Not Found
Date: Tue, 01 Jan 2013 21:04:05 GMT
Server: Apache
X-Powered-By: PHP/5.2.9
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0


Here's my environment:
# concrete5 Version
5.6.0.1
# concrete5 Packages
Billboards (1.2.4), Content Around Image (1.23), Extended Form (2.6), Gallery (1.8), Mega Menu (1.5.2), YouTube Pro (1.0).
# concrete5 Overrides
blocks/login, blocks/mylab_easy_tabs, blocks/autonav, blocks/search, blocks/superfish, elements/header_required.php, helpers/miser_support, helpers/miser.zip, helpers/miser.php, js/jquery.megamenu.js, libraries/view.php.zip, single_pages/page_not_found.php, themes/theme_credo3, themes/theme_portal3
# Server Software
Apache
# Server API
cgi
# PHP Version
5.2.9
# PHP Extensions
apc, bcmath, bz2, calendar, cgi, ctype, curl, date, dbase, dom, eAccelerator, exif, filter, ftp, gd, gettext, gmp, hash, iconv, imap, ionCube Loader, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, SQLite, standard, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Optimizer, zip, zlib.
# PHP Settings


I was running Miser and thought perhaps that was the issue (thinking the file had been minified or compressed), but that is not causing the problem. Nothing changes with Miser enabled/disabled.

Any ideas on how to troubleshoot?

Type: Discussion
Status: New
invision
View Replies: View Best Answer
jb1 replied on at Permalink Reply
jb1
A couple things to check:
1) Firstly this the PIE.php file should exist (/packages/jb_megamenu/blocks/jb_megamenu/js/PIE.php) - it's part of the package, so I'm not sure why it's not on your server. Try uploading that file again manually just to double check. That PHP file simply loads the HTC file within the same folder.

2) If you have the "Access Keys" feature turned on in Mega Menu, try turning that off. In cases where the number of menu items exceeds 26 there are no more letters in the alphabet available to assign as shortcuts, it can continue to look for available letters without avail.

3) Ensure you're using the latest version (1.5.2)

4) In the block controller.php file you will find this code around line 152:
protected $btCacheBlockRecord = true;
protected $btCacheBlockOutput = true;
protected $btCacheBlockOutputOnPost = true;
protected $btCacheBlockOutputForRegisteredUsers = false;
protected $btCacheBlockOutputLifetime = CACHE_LIFETIME;

This controls how the block responds to the C5 caching system. You'll notice the 4th variable turns off caching for this block when the user is logged in. So you can try testing your site performance when you're not logged in, or you can change that variable to "true". The reason for turning it to "false" is that when it's "true" the integrated "login" feature doesn't work because C5 will continue to show the login form even when the user is logged in (and vice versa).

Let me know if that helps.

JB
invision replied on at Permalink Reply
invision
JB,

1) First thing I checked was your pie.php code and to be sure both pie.php and pie.htc exist on the server. I can open & edit them from cPanel file manager, so they definitely exist. I just re-uploaded the individual files to be sure.
2) No access keys turned on.
3) On v. 1.5.2 (see my environment info in OP)
4) C5 cacheing turned off to use Miser (tried it with and without Miser enabled, same result). I'm testing from WebPageTest, so definitely logged out.

A couple of things I'm going to try -- turn off rounded corners & drop shadows on menus, since that's why pie.htc is even needed. FWIW, I have .htc enabled as a MIME type on my server, so perhaps I could disable the pie.php request for the file?
Also thought it might be a permissions issue, but both pie.php and pie.htc are set to 644.
Also thought it might be a PHP version issue. My server is running 5.2.9, but no clue if a newer version would make it happy.
If it makes a difference, I have the menu installed in a sitewide block area. I installed it in a regular block area in my theme and get the same results.
Baffling.
jb1 replied on at Permalink Best Answer Reply
jb1
It sounds like you covered all the bases. The biggest performance difference will be the C5 cache. Some of the menu structure generation logic in the MM controller is based on the core "autonav" block. So the performance should be similar. The biggest difference is that MM often digs several levels down within a site and often the "autonav" block is used for the top nav menus items only. You could also test that - see how the site performs without the Mega Menu and just replace it with the core Autonav block with similar settings.

If you still have performance issues, then it's not really the MM at fault, but rather an inherent performance issue with C5.

However, what should happen with C5 caching is the menu building logic should only process the first time the page is loaded, then next time it should cache the HTML output on the server so it just spits that out without all the processing, which is superfast. So if there's a noticeable slowdown with Mega Menu I'd suggest you do some further testing around the C5 cache to ensure it's actually working. If you have a site with hundreds or thousands of pages, then there could definitely be a slowdown when the full MM is processed on every page load.

Oh, and you could safely remove any reference to the pie.php file in the controller.php file to test that out as well.

JB
invision replied on at Permalink Reply
invision
So I commented out the few lines in controller.php that refer to PIE.php and it dropped 2.5 sec off the load time for the site. (And Webpagetest is no longer showing a 404 for that object).

Other than having to be careful with updates (and not overwriting my edits) I should be okay now.

BTW, love the jquery megamenu. I've used it on other static HTML projects and in Wordpress and it's a beauty. Thanks for making it work in Concrete5.
jb1 replied on at Permalink Reply
jb1
Ok, that's great to know in case anyone else has a similar question in the future. I'll keep it in mind. Thanks for your positive feedback, it's always great to hear from happy customers :-)

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.