no, you can't use / in the cache id for frontend cache currently.
This will not work too with the current code.
- Code: Select all
<!-- cache("students/{{students' value.@id}}") -->
However, you can write your functions to use Doo::cache('front') in template_tags.php
- Code: Select all
function startCache($id, $duration, $additional=''){
if (!Doo::cache('front')->getPart($additional . $id, $duration))
Doo::cache('front')->start('mydata');
}
function endCache($id, $duration, $additional=''){
if (!Doo::cache('front')->getPart($additional . $id, $duration))
Doo::cache('front')->end();
}
Template:
- Code: Select all
<!-- loop students -->
{{startCache(students' value.@id, 3600, 'students')}}
{{students' value.@name}}
{{endCache(students' value.@id, 3600, 'students')}}
<!-- endloop -->
You can have the functions to convert the / to something else like '-' or '_'