Hi opengeek,
thanks for answering.
Maybe I didn't make myself clear enough, my bad.
Chunk switching (desktop/mobile) works fine using the method above (I'm using it on various projects with no issues).
My problem is that an uncached snippet (getCurrentDate) value gets cached in "header" chunk section in core/cache/resource/web/resources/1.cache.php:
'[[$header]]' => '<!DOCTYPE html>
....
....
....
<script>
language = \'it\';
current_date = new Date(2013,1,6);
</script>
</head>
<body>
In the header chunk I have:
current_date = [[!getCurrentDate]];
I have the same setup in other projects and in core/cache/resource/web/resources/1.cache.php I have:
'[[$header]]' => '<!DOCTYPE html>
....
....
....
<script>
language = \'it\';
current_date = [[!getCurrentDate]];
</script>
</head>
<body>
I hope I made myself clear.
thanks