Welcome Guest, Not a member yet? Register   Sign In
Cache & Multi-domains
#1

[eluser]Rwkzejedi[/eluser]
Hi community,

I use CI.2 for a multilingual website.

Actually, I have some slow-down when I'm loading pages.

I think it's time to use cache... But the native cache of CI cache "too much".

I have 3 name domain pointing in the same application. Each name domain for a language.
But... with the native cache... when I switch language, He continues to read the old language cached...

So I try to use 3 differents cache path... one for each domain.
I create 3 subfolders in "application/cache (chmoded to 777) ...

But nothing happens... No files are written in the different folders. Here is my code

Code:
if(preg_match('#my_site.fr#isu',$_SERVER['HTTP_HOST']))
  {
   $requested_lang_for_domain = 'my_site.fr';
   define('ORDER_ADS_COUNTRY', 8);
   //define the cache folder
   $this->config->set_item('cache_path','/application/cache/fr/');
  }
  elseif(preg_match('#my_site.es#isu',$_SERVER['HTTP_HOST']))
  {
   $requested_lang_for_domain = 'my_site.es';
   define('ORDER_ADS_COUNTRY', 6);
   //define the cache folder
   $this->config->set_item('cache_path','/application/cache/es/');
  }
  else
  {
   $requested_lang_for_domain = 'my_site.com';
   //define the cache folder
   $this->config->set_item('cache_path','/application/cache/en/');
  }
  
  //now we load the domain info with lang
  $lang = $this->langue_model->get_lang($requested_lang_for_domain);
  
  //change base url
  $this->config->set_item('base_url','http://www.'.$requested_lang_for_domain);
  
  //cache during 5 minutes
  $this->output->cache(5);

Do you have an idea ?
Do the native cache of CI works with dynamics datas ? I have an account system. If I login in the website, do my personnal datas are loaded or it's those on the cache ? (Hope it's mine)

Sorry for my bad english, it's not my native language.

Sincerely


Messages In This Thread
Cache & Multi-domains - by El Forum - 03-19-2013, 04:05 AM
Cache & Multi-domains - by El Forum - 03-19-2013, 04:29 AM
Cache & Multi-domains - by El Forum - 03-19-2013, 06:41 AM
Cache & Multi-domains - by El Forum - 03-19-2013, 07:25 AM
Cache & Multi-domains - by El Forum - 03-19-2013, 07:50 AM
Cache & Multi-domains - by El Forum - 03-19-2013, 07:59 AM
Cache & Multi-domains - by El Forum - 03-20-2013, 01:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB