Welcome Guest, Not a member yet? Register   Sign In
In Codeigniter, Twig project always to refresh cache
#1

Hello,
In Codeigniter 3.0.6, Twig 1.24.0 project if in twig code I would like to clear all cache on any page reload.
In some cases it seems to me, that after I modify some twig and reload page by CTRL+R, the new changes were not applied to this page.
After I manually delete twig files it works ok.

twig is included to project as library https://github.com/kenjis/codeigniter-ss-twig:

PHP Code:
        $twig_config = array();
        $this->load->library('twig'$twig_config);
        $twig_Environment $this->twig->getTwig(); 


$this->config is filled with :

PHP Code:
$this->config::Array
(
    [paths] => Array
        (
            [0] => /mnt/diskD_Work/wwwroot/tb/application/views/
        )

    [cache] => /mnt/diskD_Work/wwwroot/tb/application/cache/twig


In $twig_Environment object output:

PHP Code:
$twig_Environment::Twig_Environment Object
(
    [charset:protected] => UTF-8
    
[loader:protected] => Twig_Loader_Filesystem Object
        
(
            [paths:protected] => Array
                (
                    [__main__] => Array
                        (
                            [0] => /mnt/diskD_Work/wwwroot/tb/application/views
                        
)

                )

            [cache:protected] => Array
                (
                )

            [errorCache:protected] => Array
                (
                )

        )

    [debug:protected] => 
    
[autoReload:protected] => 
    
[cache:protected] => Twig_Cache_Filesystem Object
        
(
            [directory:Twig_Cache_Filesystem:private] => /mnt/diskD_Work/wwwroot/tb/application/cache/twig/
            [options:Twig_Cache_Filesystem:private] => 0
        


In codeigniter-ss-twig object I see :

PHP Code:
$debugtrue// for development envierement of CI project.
$twig = new \Twig_Environment($this->loader, [
  'cache'      => $this->config['cache'],
  'debug'      => $debug,
  'strict_variables'      => $debug,
  'autoescape' => TRUE,
]); 
If there are some more options/tuning to update cache any time I reload my page?


  Thanks !
Reply




Theme © iAndrew 2016 - Forum software by © MyBB