Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 11:17 am (All times are UTC )

 




Post new topic Reply to topic  [ 26 posts ] 
Author Message
Posted: Tue Nov 14, 2006 4:15 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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.


Last edited by Robin on Tue Nov 21, 2006 12:54 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Tue Nov 21, 2006 12:54 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15089
Moderator note; topic split from tips/tricks topic.

_________________
Regards Robin


Top
   
 
Posted: Sun Nov 26, 2006 11:23 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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.


Top
  E-mail  
 
Posted: Wed Dec 20, 2006 8:01 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Sun Nov 27, 2005 11:27 am
Posts: 89
Could you explain us exactly what you modified and where? Please post the new code...

_________________
http://www.elearnit.net
http://pastoweb.altervista.org/


Top
  E-mail  
 
Posted: Wed Dec 20, 2006 11:12 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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:

Code:
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ENG
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ESP


The code change in file includes/Cache/Lite.php is as follows:


Code:
       
        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;
                }

        }


It is working now with cache on at http://www.conscious-robots.com


Top
  E-mail  
 
Posted: Sun Jan 14, 2007 5:30 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 6:15 am
Posts: 1551
Location: Munich, Germany
Can you all check the latest Joomla! core 1.0.12 - we fixed something related to the cache.

Alex

_________________
Joomla! Community Oversight Committee Member, follow me on twitter @akempkens
Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish
Think Network, Munich - http://www.ThinkNetwork.com


Top
   
 
Posted: Mon Jan 15, 2007 5:04 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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..


Top
  E-mail  
 
Posted: Mon Jan 15, 2007 6:09 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 6:15 am
Posts: 1551
Location: Munich, Germany
:( The changes we did wasn't in the CacheLite files but in the files that called this class.

Need to check

_________________
Joomla! Community Oversight Committee Member, follow me on twitter @akempkens
Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish
Think Network, Munich - http://www.ThinkNetwork.com


Top
   
 
Posted: Mon Jan 15, 2007 9:31 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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


Top
  E-mail  
 
Posted: Tue Jan 16, 2007 5:15 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 6:15 am
Posts: 1551
Location: Munich, Germany
Ok we will try to hunt down what's the issue still. Thx for the feedback

_________________
Joomla! Community Oversight Committee Member, follow me on twitter @akempkens
Joom!Fish 2.0 your free multilingual solution for Joomla! 1.5 i - http://www.joomfish.net - follow us on twitter @joomfish
Think Network, Munich - http://www.ThinkNetwork.com


Top
   
 
Posted: Tue Jan 16, 2007 9:58 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
Thanks! I'll restore the _setFileName function trick for the time being..


Top
  E-mail  
 
Posted: Fri Jan 26, 2007 5:39 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Jan 26, 2007 5:34 pm
Posts: 1
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...


Top
   
 
Posted: Sun Feb 04, 2007 8:02 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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.


Top
  E-mail  
 
Posted: Wed Feb 21, 2007 5:09 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Feb 21, 2007 3:50 pm
Posts: 8
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:

Code:
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ENG
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ESP


The code change in file includes/Cache/Lite.php is as follows:



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:

Code:
       
        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;
                }

        }


Top
  E-mail  
 
Posted: Wed Feb 21, 2007 5:28 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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.


Top
  E-mail  
 
Posted: Sun Mar 04, 2007 4:15 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Dec 06, 2006 3:43 pm
Posts: 1
10x guys for this  nice hack!  :o :D

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

Code:
   /**
   * 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;
                }

        }



Top
  E-mail  
 
Posted: Sat Jul 21, 2007 10:51 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 14, 2007 10:00 pm
Posts: 16
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?


Top
  E-mail  
 
Posted: Sat Jul 21, 2007 7:27 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 14, 2007 10:00 pm
Posts: 16
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.


Top
  E-mail  
 
Posted: Sat Jul 21, 2007 8:30 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Sep 02, 2005 8:45 pm
Posts: 39
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?


it sems to me like the weird behaviour only (and always) comes when calling the main site, i.e. without "parameters".
did you try disabling your SEF component?


Top
   
 
Posted: Sun Jul 22, 2007 6:32 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 14, 2007 10:00 pm
Posts: 16
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.


Top
  E-mail  
 
Posted: Sun Jul 22, 2007 9:41 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
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?


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?

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...


Top
  E-mail  
 
Posted: Sun Jul 22, 2007 9:53 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 14, 2007 10:00 pm
Posts: 16
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.


Top
  E-mail  
 
Posted: Fri Aug 03, 2007 7:15 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Feb 23, 2006 2:17 am
Posts: 349
Location: Norway
I'm having trouble with cache + joomfish + sh404SEF. No 404, but only default languge articles show up...

_________________
http://www.peshmedia.no


Top
  E-mail  
 
Posted: Fri Aug 03, 2007 11:35 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 14, 2007 10:00 pm
Posts: 16
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.


Top
  E-mail  
 
Posted: Sat Aug 04, 2007 7:05 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Feb 23, 2006 2:17 am
Posts: 349
Location: Norway
Interesting, I will try a little harder...

_________________
http://www.peshmedia.no


Top
  E-mail  
 
Posted: Mon Nov 05, 2007 4:33 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 30, 2006 10:48 am
Posts: 27
Location: Madrid
It seems that upgrading to Joom!Fish 1.8 fixed this problem for me  8)  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.


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group