Joom!Fish and cache enabled
Moderator: General Support Moderators
Forum rules
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Joom!Fish and cache enabled
Hi, I am using Joomla 1.0.11 + JoomFish 1.7, and I'm having problems when I turn cache on. News are showed in the latest cached language (no matter what language you select). It only appears in the right language when cache expires..
The only workaround for this issue that I know is to turn cache off, but then the loading speed sucks.. Does anyone know of a fix for this issue?
Thanks!
Raúl.
The only workaround for this issue that I know is to turn cache off, but then the loading speed sucks.. Does anyone know of a fix for this issue?
Thanks!
Raúl.
Last edited by Robin on Tue Nov 21, 2006 12:54 pm, edited 1 time in total.
- Robin
- Joomla! Master
- Posts: 15745
- Joined: Thu Aug 18, 2005 10:41 am
Re: Joom!Fish and cache enabled
Moderator note; topic split from tips/tricks topic.
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
Thanks RobInk,
What I did is to change the Cache-Lite code to add a flag in the cache file names, thus the language is taken into account. This way the languages are not messed up when I turn on the Joomla cache.
What I did is to change the Cache-Lite code to add a flag in the cache file names, thus the language is taken into account. This way the languages are not messed up when I turn on the Joomla cache.
-
- Joomla! Enthusiast
- Posts: 147
- Joined: Sun Nov 27, 2005 11:27 am
- Contact:
Re: Joom!Fish and cache enabled
Could you explain us exactly what you modified and where? Please post the new code...
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
Sure, I am far from being a php coder, so the altered code is not probably the best approach, anyhow it works and as it is a really small change I didn't bother trying to get it better written.
The idea is to distinguish between languages in the cache generated files, so I have added a flag at the end of every cache file name: ENG for English piece of content, and ESP for Spanish piece of content:
The code change in file includes/Cache/Lite.php is as follows:
It is working now with cache on at http://www.conscious-robots.com
The idea is to distinguish between languages in the cache generated files, so I have added a flag at the end of every cache file name: ENG for English piece of content, and ESP for Spanish piece of content:
Code: Select all
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ENG
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ESP
Code: Select all
function _setFileName($id, $group)
{
global $mosConfig_lang;
if ($mosConfig_lang == english )
{
$idioma = "_ENG";
}
if ($mosConfig_lang == spanishi )
{
$idioma = "_ESP";
}
if ($this->_fileNameProtection) {
$this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id).$idioma);
} else {
$this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id.$idioma;
}
}
- akede
- Joomla! Ace
- Posts: 1258
- Joined: Fri Aug 12, 2005 6:15 am
- Location: Munich, Germany
- Contact:
Re: Joom!Fish and cache enabled
Can you all check the latest Joomla! core 1.0.12 - we fixed something related to the cache.
Alex
Alex
Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish
Meet us at J and Beyond, 30.05 - 1.06.10, Wiesbaden, Germany - http://jandbeyond.org
Meet us at J and Beyond, 30.05 - 1.06.10, Wiesbaden, Germany - http://jandbeyond.org
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
I've upgraded my site to Joomla! Core 1.0.12 using the patch Joomla_1.0.11_to_1.0.12-Stable-Patch_Package.zip
This patch doesn't include any CacheLite file, so I see no change from 1.0.11..
This patch doesn't include any CacheLite file, so I see no change from 1.0.11..
- akede
- Joomla! Ace
- Posts: 1258
- Joined: Fri Aug 12, 2005 6:15 am
- Location: Munich, Germany
- Contact:
Re: Joom!Fish and cache enabled

Need to check
Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish
Meet us at J and Beyond, 30.05 - 1.06.10, Wiesbaden, Germany - http://jandbeyond.org
Meet us at J and Beyond, 30.05 - 1.06.10, Wiesbaden, Germany - http://jandbeyond.org
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
OK, so I removed the changes in CacheLite described in this thread, i.e. restored original CacheLite _setFileName function.
And I get a weird behaviour: if you go to a content page, it seems to work ok, whenever you switch the language you get the right translated content, however, if you go to the frontpage or a category/section page, the first cached language remains (language switching is not working).
I will keep the original CacheLite code for some hours so you can see it for yourself online at
http://www.conscious-robots.com
And I get a weird behaviour: if you go to a content page, it seems to work ok, whenever you switch the language you get the right translated content, however, if you go to the frontpage or a category/section page, the first cached language remains (language switching is not working).
I will keep the original CacheLite code for some hours so you can see it for yourself online at
http://www.conscious-robots.com
- akede
- Joomla! Ace
- Posts: 1258
- Joined: Fri Aug 12, 2005 6:15 am
- Location: Munich, Germany
- Contact:
Re: Joom!Fish and cache enabled
Ok we will try to hunt down what's the issue still. Thx for the feedback
Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish
Meet us at J and Beyond, 30.05 - 1.06.10, Wiesbaden, Germany - http://jandbeyond.org
Meet us at J and Beyond, 30.05 - 1.06.10, Wiesbaden, Germany - http://jandbeyond.org
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
Thanks! I'll restore the _setFileName function trick for the time being..
-
- Joomla! Fledgling
- Posts: 1
- Joined: Fri Jan 26, 2007 5:34 pm
Re: Joom!Fish and cache enabled
And I thought I was going crazy... same problem here...
The lovely thing called multilingual Joomla! sites
Turned off the caching... for the time being...
Hope you fix it soon...
The lovely thing called multilingual Joomla! sites
Turned off the caching... for the time being...

Hope you fix it soon...
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
Well, while you wait for an official fix, you could turn chache on and apply the _setFileName function patch as explained above.
This is what I did, and it is working fine for two languages.
This is what I did, and it is working fine for two languages.
-
- Joomla! Apprentice
- Posts: 8
- Joined: Wed Feb 21, 2007 3:50 pm
Re: Joom!Fish and cache enabled
I'm no php coder either, but instead of using the if statements I just changed the $idioma to $mosConfig_lang, so my section looks like:array2001 wrote:
Sure, I am far from being a php coder, so the altered code is not probably the best approach, anyhow it works and as it is a really small change I didn't bother trying to get it better written.
The idea is to distinguish between languages in the cache generated files, so I have added a flag at the end of every cache file name: ENG for English piece of content, and ESP for Spanish piece of content:
The code change in file includes/Cache/Lite.php is as follows:Code: Select all
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ENG cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ESP
Code: Select all
function _setFileName($id, $group)
{
global $mosConfig_lang;
if ($this->_fileNameProtection) {
$this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id).$mosConfig_lang);
} else {
$this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id.$mosConfig_lang;
}
}
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
Cool, much more compact and elegant
This way you don't need to alter the code again if you add additional languages... which was a problem of the code I sent originally.
Thanks mbreiden.

Thanks mbreiden.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed Dec 06, 2006 3:43 pm
Re: Joom!Fish and cache enabled
10x guys for this nice hack!

A little change from me to include "_" before language descriptor:


A little change from me to include "_" before language descriptor:

Code: Select all
/**
* Make a file name (with path)
*
* @param string $id cache id
* @param string $group name of the group
* @access private
*/
function _setFileName($id, $group)
{
global $mosConfig_lang;
if ($this->_fileNameProtection) {
$this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id).'_'.$mosConfig_lang);
} else {
$this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id.'_'.$mosConfig_lang;
}
}
- gaupe
- Joomla! Apprentice
- Posts: 16
- Joined: Sat Jul 14, 2007 10:00 pm
Re: Joom!Fish and cache enabled
Hmm i have implemented this on my website but found out there's still a sort of problem with the caching
(it is'nt there if you turn the cache off so it must be the cache that causes it.)
I checked it on the webite mentioned http://www.conscious-robots.com and it shows the same behaviour.
This is that if you click on a story and therewith open it in the main window. and then from there choose another language.
It, not allways, shows the same article but in many cases another (previous cached?) article....
I'm not sure what causes this nor do i know how to solve it, somebody any ideas?
(it is'nt there if you turn the cache off so it must be the cache that causes it.)
I checked it on the webite mentioned http://www.conscious-robots.com and it shows the same behaviour.
This is that if you click on a story and therewith open it in the main window. and then from there choose another language.
It, not allways, shows the same article but in many cases another (previous cached?) article....
I'm not sure what causes this nor do i know how to solve it, somebody any ideas?
- gaupe
- Joomla! Apprentice
- Posts: 16
- Joined: Sat Jul 14, 2007 10:00 pm
Re: Joom!Fish and cache enabled
Well for me i installed Jaccelerator and this caching software seems to work flawless for me.
i see that it is language specific (in the cache files) i allso choose what to cache and what not so it is allso
much more customizable.
i see that it is language specific (in the cache files) i allso choose what to cache and what not so it is allso
much more customizable.
-
- Joomla! Apprentice
- Posts: 39
- Joined: Fri Sep 02, 2005 8:45 pm
- Contact:
Re: Joom!Fish and cache enabled
it sems to me like the weird behaviour only (and always) comes when calling the main site, i.e. without "parameters".gaupe wrote: Hmm i have implemented this on my website but found out there's still a sort of problem with the caching
(it is'nt there if you turn the cache off so it must be the cache that causes it.)
I checked it on the webite mentioned http://www.conscious-robots.com and it shows the same behaviour.
This is that if you click on a story and therewith open it in the main window. and then from there choose another language.
It, not allways, shows the same article but in many cases another (previous cached?) article....
I'm not sure what causes this nor do i know how to solve it, somebody any ideas?
did you try disabling your SEF component?
- gaupe
- Joomla! Apprentice
- Posts: 16
- Joined: Sat Jul 14, 2007 10:00 pm
Re: Joom!Fish and cache enabled
ah well like i said the moment i put in the jaccelerator the problem vanished.
can be that the sef has some to do with it i dont know but as i dont want to do without the sef (i want search engines to find my translations) it wont help me much if it would work without sef.
i now played with the site all day and with jaccelerator all is fine.
can be that the sef has some to do with it i dont know but as i dont want to do without the sef (i want search engines to find my translations) it wont help me much if it would work without sef.
i now played with the site all day and with jaccelerator all is fine.
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
Yup, that is my site. I know that problem, but I've been postponing the investigation of a fix as I've been busy with other stuff.. I thought that the problem is caused by the JoomSEF component.. Are you you using the same component for SEO?gaupe wrote: Hmm i have implemented this on my website but found out there's still a sort of problem with the caching
(it is'nt there if you turn the cache off so it must be the cache that causes it.)
I checked it on the webite mentioned http://www.conscious-robots.com and it shows the same behaviour.
This is that if you click on a story and therewith open it in the main window. and then from there choose another language.
It, not allways, shows the same article but in many cases another (previous cached?) article....
I'm not sure what causes this nor do i know how to solve it, somebody any ideas?
I could try the same as you and use JAcceletator and see if the problem disappear. That would confirm that is nothing to do with SEF, and Joomla caching is the root cause.
Anyhow I think there's something wrong with my JoomSEF as I have aroung 20000 translated URLs in the database! And most of them seem to return 404...
- gaupe
- Joomla! Apprentice
- Posts: 16
- Joined: Sat Jul 14, 2007 10:00 pm
Re: Joom!Fish and cache enabled
I am using the sh404sef and it looked until now to be without any problem had the cache of jaccellerator in 1d1h (The default)
and was busy all day translating in two extra languages (dutch and norwegian from english)
later when we finished translating i was playing a litle with the setup and (put jaccelerator on 5d1 allso put the urlcache of the sh404sef on ) and suddenly i got all 404s too and all links where pointing to wron language parts of the content.....
cleaned out all the caches from both the sh404sef and jaccellerator and all was fine again....
Hmmm have to play with this a little longer i guess to see if this solution is worry free.....
but am curious at your findings.
and was busy all day translating in two extra languages (dutch and norwegian from english)
later when we finished translating i was playing a litle with the setup and (put jaccelerator on 5d1 allso put the urlcache of the sh404sef on ) and suddenly i got all 404s too and all links where pointing to wron language parts of the content.....
cleaned out all the caches from both the sh404sef and jaccellerator and all was fine again....
Hmmm have to play with this a little longer i guess to see if this solution is worry free.....
but am curious at your findings.
- perandre
- Joomla! Explorer
- Posts: 350
- Joined: Thu Feb 23, 2006 2:17 am
- Location: Norway
- Contact:
Sv: Joom!Fish and cache enabled
I'm having trouble with cache + joomfish + sh404SEF. No 404, but only default languge articles show up...
- gaupe
- Joomla! Apprentice
- Posts: 16
- Joined: Sat Jul 14, 2007 10:00 pm
Re: Joom!Fish and cache enabled
ah well played with it for some days and didn't see any problems anymore.
the clearing of all the caches in accelerator and the sef and then no changes anymore in the settings of these two gave errorfree
driving.... as far as i can see.
the clearing of all the caches in accelerator and the sef and then no changes anymore in the settings of these two gave errorfree
driving.... as far as i can see.
- perandre
- Joomla! Explorer
- Posts: 350
- Joined: Thu Feb 23, 2006 2:17 am
- Location: Norway
- Contact:
- array2001
- Joomla! Apprentice
- Posts: 27
- Joined: Mon Oct 30, 2006 10:48 am
- Location: Madrid
- Contact:
Re: Joom!Fish and cache enabled
It seems that upgrading to Joom!Fish 1.8 fixed this problem for me
So I keep on using JoomSEF, Joomla Cache and JF 1.8, and finally I can switch any content from one language to another without a problem.
You can have a look at http://www.conscious-robots.com. Please, let me know if you see any bad language switch with your browsers.. Thx!
Cheers,
Raul.

You can have a look at http://www.conscious-robots.com. Please, let me know if you see any bad language switch with your browsers.. Thx!
Cheers,
Raul.