• I have discovered, through a process of elimination that it is my menu that slows down my blog. I use a PixoPoint Multi-level plugin for the menu. The menu is pretty big and it is loaded with every page. With the menu it takes approx 23 seconds to load a page, if I disable the menu a page load is under 5 seconds.

    I would like to cache nothing but the menu and only load it the first time the app is loaded so that subsequent page loads do not have to load it again, it is just added from the cache locally.

    I know that partial-page caching is done in asp.net, but that is done by using user controls.

    Does anyone know how to do this? I’ve read that it is called “fragment caching” in PHP.

    Doug

Viewing 15 replies - 1 through 15 (of 19 total)
  • Hi,
    Sorry about that. I’m the developer of the plugin. I rewrote the plugin from scratch recently to solve those performance problems, but I haven’t heard any reports from anyone who has used it so it hasn’t been pushed live onto the repository yet.
    http://pixopoint.com/2012/04/05/multi-level-navigation-plugin-update/

    I would really appreciate it if you could try it to see if it solves your performance problems.

    Thanks 🙂

    Oh, and if you really want to crank up performance, you should use the WordPress transient API to cache the menu contents, and turn off the plugins built in CSS file and move the CSS to your theme (or use a plugin which can dynamically concatenate your CSS files such as W3 Total Cache).

    That does require some technical know how to implement though.

    Thread Starter dpdoug

    (@dpdoug)

    I installed the new plugin and tried it out and after the first load (15 sec) each page loads in 3 seconds — I am extremely happy with the new menu!

    There is one thing that I would like to change though. I have to make a copy of each post and create a page just for the purpose creating the menu. I have a page, without post text, just for the purpose of having a top level menu item. Then I use the pages with the texts as children of the top level menu.

    I would rather do the same for posts. That way I wouldn’t have to update the pages every time I change something in a post and I wouldn’t have to create duplicate pages for each post. Is there some way that I could implement this?

    If I use categories for the top level menu items, the posts in each category don’t appear as child menu items. I’d like to be able to use posts the same way I use pages.

    Probably the only way to go is use pages instead of posts, but then I wouldn’t have the recent posts to show.

    I’d like to have my cake and eat it too…

    Thread Starter dpdoug

    (@dpdoug)

    I’ve tried creating a custom menu going by the example, but when I save it the code in the “Custom Code” text box goes away and the menu is not displayed. Evidently this is a glitch.

    I thought maybe this could be a way to display my posts in the menu and not have to create (duplicate) pages just for the sake of having a menu.

    Alas… it doesn’t work. 🙁

    I’ll see what I can do about that glitch. Thanks for letting me know about it, I really appreciate the feedback 🙂

    It sounds like the functionality you want could be achieved most easily by uninstalling the plugin and using the built-in system for menus in WordPress. I built the plugin a long time before menus were implemented in core and for most people the built-in system is far more useful.

    Thread Starter dpdoug

    (@dpdoug)

    Is it just as fast?

    It uses far more database queries. There are ways to cache the menu output, but it would require some PHP knowledge to figure out how to do the caching of them.

    Other than the number of queries it should be roughly the same speed as my plugin though.

    I supposed I could take this opportunity to write up a “how to” guide on caching WordPress menu outputs I guess. Lots of people SHOULD be caching their menus, but almost nobody does.

    Thread Starter dpdoug

    (@dpdoug)

    I think that creating the code for the menu might not only run faster, but just about as easy as I know HTML very well.

    Writing raw HTML will always be faster. Although at that point you may as well dump the code straight into your theme rather than using a plugin.

    I found a tutorial here on caching WordPress menu outputs … http://hitchhackerguide.com/2011/10/07/caching-wordpress-navigation-menus-wp_nav_menu-wrapper/

    That tutorial is a little overly verbose in my opinion as you can do the caching with a lot less code than that, but it does make sense and should work just fine.

    Thread Starter dpdoug

    (@dpdoug)

    I’ve read some on caching, but PHP is not my forte. I’m a .net programmer. A “how to” guide on caching WordPress menu outputs would be extremely useful to me. Some of those tutorials are written assuming that the reader is a seasoned programmer in PHP, so it’s difficult to know how to use the code.

    I understand there is database caching and memory caching. I think I’d be more interested in memory caching since it is much faster.

    This looks a little simpler 🙂
    http://www.dev4press.com/2011/tutorials/wordpress/practical/improve-your-wordpress-website-speed-part-2/

    This same method of caching can be used for many parts of your site, including widget areas etc. It’s a really handy technique for situations in which you can’t use a static file caching plugin like W3 Total Cache or WP Super Cache.

    Thread Starter dpdoug

    (@dpdoug)

    How would I go about “dumping the code straight into my theme”? Where would I put the code? If I did this would I still be able to cache it?

    Thread Starter dpdoug

    (@dpdoug)

    I’ve tried WP Super Cache, and I don’t like the fact that I just makes copies of the whole page. So it just serves up a static page from the server instead of actually caching fragments of the page on the client side.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘fragment caching for PixoPoint Multi-level menu’ is closed to new replies.