0
Welcome Guest! Login
0 items Join Now

Template menu caching and URL problems

    • robmad's Avatar
    • robmad
    • Newbie
    • Posts: 14
    • Thanks: 0

    Template menu caching and URL problems

    Posted 14 years 3 months ago
    • We use RocketTheme Versatility 4 since a while ago and have stumbled across a problem it seems with SEF and URLs. After some time the URLs from the main menu seem to get jumbled up (with index.php/category/ etc) inserted and it breaks all links and you get a page with out CSS. It only happens if core cache is on and core SEF is on. If we turn cache off, then the links go back to normal, but obviously we don't benefit from the caching. It works for a little while, but after some period it starts breaking stuff.

      As the mainmenu is set in the template and not as a module (using MooMenu), could this be that the menu is somehow cached and this becomes garbled? Or what could be going on here?

      Thanks
    • theITD's Avatar
    • theITD
    • Newbie
    • Posts: 2
    • Thanks: 0

    Re: Template menu caching and URL problems

    Posted 13 years 7 months ago
    • I'm surprised that there isn't more on this problem in the forums. I've been running the same setup (Joomla 1.5, Versatility Template, SEF On & Cache ON) for a couple of years - and I never found a way of making the core cache plugin 'play nice' with the main menu.

      After a lot of trial & error (as you suggested, the problem seems to appear after the caching-time expires) - I found another cache plugin which worked. JotCache website is here:

      www.kanich.net/radio/site/jotcache/download

      I also tried various combinations of compression & minify-ing, to attempt to speed up the pages. And again, this caused problems. In the end, I used the following:

      These settings have a lot of effect when it comes to improving the speed of the site - but they are a compromise on what appears to be a show-stopping bug. As I host multiple joomla sites on the same box, the menu started caching https:// addresses using 'neighbouring' domains. This caused serious issues, not to mention the added load on the server by disabling caching.

      Short of adding a new template position, cutting and pasting the menu code, and publishing the new main menu as a 'no-cache' module - is there any other fix? I know this is an old post, and I don't mean to unnecessarily bump it - but the solution has been a long time coming!
  • Re: Template menu caching and URL problems

    Posted 13 years 7 months ago
    • robmad wrote:
      We use RocketTheme Versatility 4 since a while ago and have stumbled across a problem it seems with SEF and URLs. After some time the URLs from the main menu seem to get jumbled up (with index.php/category/ etc) inserted and it breaks all links and you get a page with out CSS. It only happens if core cache is on and core SEF is on. If we turn cache off, then the links go back to normal, but obviously we don't benefit from the caching. It works for a little while, but after some period it starts breaking stuff.

      As the mainmenu is set in the template and not as a module (using MooMenu), could this be that the menu is somehow cached and this becomes garbled? Or what could be going on here?

      Thanks
      I have the same setup and I am not facing any problems...

      Maybe it's something else that's causing this?
    • You can call me George
      J2.5.8, Panacea v1.6.6 - www.eks-ik.eu
      J2.5.8, Syndicate 1.6.5
    • Barkley's Avatar
    • Barkley
    • Hero Rocketeer
    • Posts: 253
    • Thanks: 0

    Re: Template menu caching and URL problems

    Posted 13 years 6 months ago
    • I have had the same problem and in fact cannot get it to work with Jotcache either. Can you share with me your Jotcache settings. Also for what its worth, it seems to only happen in IE browsers. JotCache updated the plugin for me (now available publicly) to build separate cache files by browser type (breaks out all of them now (Firefox, IE, Chrome, etc) so that the correct css file is applied by browser type. The menu ONLY seems to get messed up in IE...
    • Visit our pet magazine at www.barkleyandpaws.com
    • theITD's Avatar
    • theITD
    • Newbie
    • Posts: 2
    • Thanks: 0

    Re: Template menu caching and URL problems

    Posted 13 years 6 months ago
    • I think I've found the issue. It seems to be a problem with Joomla 1.5 - and not with Versatility.
      This link describes a bug with the "base href=" using the 'current' host address instead of the address specified in the configuration.php file. As my site is still visited using an old URL, the cache 'inherited' this address until it expired.

      Edit <joomla_root>/includes/application.php on line 108 and change:
      $document->setBase(JURI::current());

      to
      $document->setBase(JURI::base());

      Thanks to ANT on the Joomla forums

      =================================================

      The second thing I did (actually just before making the change above) is set the permissions on the mod_mainmenu cache folder to read-only (after making sure the menu was correct). This isn't ideal, but it does avoid the files being recreated with the wrong address.

      (The directory is <joomla_root>/cache/mod_mainmenu - see below).

      dr--r--r-- 2 root root 4096 2011-10-11 10:06 mod_mainmenu

      ==================================================

      Lastly, the settings for JotCache that work for me are:
      • Use Browser Caching: YES
      • Cache Lifetime: 45
      • Compress Cached Content: NO (This was the main culprit)
      • Mark Caching: NO
      • Cache Auto Clean: 180
      • Clean Log: NO
      • Browser Split: <not used>
      • Global Exclude: <not used>

Time to create page: 0.103 seconds