Slow menu - don't know why

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Jonas
Beginner
Beginner
Posts: 5
Joined: Fri Aug 27, 2004 10:55 am

Slow menu - don't know why

Post by Jonas »

The menu can be seen here and is slow (and sometimes does not appear): http://www.arcadesreseau.be/index.php

Mind the index.php, the index.html is a static temporary placeholder.

The menu data is build using php and the data file can be accessed on this url: http://www.arcadesreseau.be/index.php?menu=1

As you can see, the menu is not very big at all. I am using IE6 at the moment and maybe it is because I have some previous version (development version on my machine) cached or something, no clue.

Customer has not complained yet but I suspect that will not last very long...

Any hints on this case for speed improvements (I have to do a reload on most of the pages to let the menu show up anyhow).

Help would be appreciated - thanks
jonas

PS menu version is 5.44 - and empying the cache does not help
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

There are some very weird things happening on your website.

I think it might be because you've named the menu index.php and the default page is also index.php.

When the menu fails to appear and I do a "View Source", I get the menu data file come up. If I refresh the page so the menu works, I get the source for the page. I'm guessing there is a conflict somewhere that the browser is getting confused by, possibly because of the file name matching.

This only happens with Internet Explorer, all other browsers seem to be fine. I'm guessing it's a bug with the browser but can't say for sure.

Can you not rename the menu_data file to something other than index.php? - Don't forget that the web server could be sending bad headers because the filename matches the servers Default page setting. I've never seen this before, it's very odd.

Cheers
Andy
Jonas
Beginner
Beginner
Posts: 5
Joined: Fri Aug 27, 2004 10:55 am

You are probably right

Post by Jonas »

I guess you are right about the naming conflict. I will put the php code for the data in a separate file and test it later on the production server. On my own machine I never experienced the problem.

I will also post a followup.


thanks for your reply,
jonas
Jonas
Beginner
Beginner
Posts: 5
Joined: Fri Aug 27, 2004 10:55 am

Solved

Post by Jonas »

putting the menu data in a separate .php file does seem to correct the weird behaviour.

thanks again
jonas
perldev
Mega User
Mega User
Posts: 115
Joined: Thu Aug 26, 2004 5:23 pm
Location: Chicago

Post by perldev »

It's a cache issue. You may put an alert in your data file. When you visit the cached one, the alert won't show up, i.e. the data js won't be called.
Jonas
Beginner
Beginner
Posts: 5
Joined: Fri Aug 27, 2004 10:55 am

How do I do that?

Post by Jonas »

And how can I put an alert in the data file so it will not show up?
perldev
Mega User
Mega User
Posts: 115
Joined: Thu Aug 26, 2004 5:23 pm
Location: Chicago

Post by perldev »

I didn't say it clear, sorry. In menu_data.js, add alert("In menu_data.js"); If the alert shows up, the menu should be printed. Otherwise the data js will not be invoked.
Jonas
Beginner
Beginner
Posts: 5
Joined: Fri Aug 27, 2004 10:55 am

Fixed it...

Post by Jonas »

In the menu.php file (which retrieves the menu data separate from the main index.php script) I had some ob_start() and other outbut buffering commands combined that seemed to F*k up the output in a way the IE JS interpreter does not like it. I cleaned up the menu.php file, did everything straightforward and now I am under the impression (knock wood) that the menu works fine as it should be...

Andy and perldev, thanks for your feedback. I am just adding this reply to make sure someone else would not make the same mistakes.

thx
jonas

PS just an extra: I also removed all the whitespace from the menu.php script..
Post Reply