Duplicate mod_menu cache files

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
User avatar
jk1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 190
Joined: Thu Sep 21, 2006 8:53 pm

Duplicate mod_menu cache files

Post by jk1 » Tue May 26, 2020 5:51 pm

My Joomla 3.6.18 website collects a lot of duplicate cache files for a menu module holding approxmately 50 internal links in the mod_menu cache folder. I suppose normally, when a new cache file is generated, it should overwrite existing old ones instead of adding duplicates. If I forget to clear the cache folders for a few weeks, the site suffers from a memory shortage (shared server). Anybody out there with a similar issue?
Joomla-mod-menu-cache-issue.png
You do not have the required permissions to view the files attached to this post.

 
helpwithjoomla
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Sat Sep 21, 2019 7:29 pm
Contact:

Re: Duplicate mod_menu cache files

Post by helpwithjoomla » Tue May 26, 2020 11:42 pm

If the module is using Global Cache settings, check the "cache time" in Global Configuration and set it something small like one day. By doing this your cache should expire and regenerate automatically each day.
Joomla Developers Available To Help With Joomla!
https://www.helpwithjoomla.com

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1740
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Duplicate mod_menu cache files

Post by SharkyKZ » Wed May 27, 2020 7:24 am

This is expected. Menu cache is based on menu item ID. For every menu item (once it's accessed by someone) a cache file is created.

User avatar
jk1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 190
Joined: Thu Sep 21, 2006 8:53 pm

Re: Duplicate mod_menu cache files

Post by jk1 » Thu May 28, 2020 7:12 pm

Thank you for your replies.
The problem seems to be that Joomla creates a new menu-cache file for every user, each holding all 50 menu items of that module. If I don't clear the cache folder frequently the site becomes slower over time because of the large number of cache files. I did use 15 minutes for the cache time and 'File' as the cache handler.
Meanwhile I've decided to set the Joomla cache from 'Conservative' to 'Off' and I observed no speed penalty doing that.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9172
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Duplicate mod_menu cache files

Post by sozzled » Thu May 28, 2020 8:03 pm

If you want, you can disable caching just for the menu. Go to Extensions » Modules and locate the module for the menu that you're having problems with. On the advanced tab for that module, find the setting Caching and set it to "No caching". Then you can re-enable caching for the rest of your site.

You can also delete all the old cache files from the filesystem (if you want) to save disk space on the server. :)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

 

Post Reply

Return to “Performance - Joomla! 3.x”