@args int val, int var @extends("main")
Note

- int val is fixed across requests
- int val is changed upon each request

code | result

###

###

    @verbatim(){

        fixed tag without cache
        fixed: @testTagCacheTag(val)

        variable tag without cache
        variable: @testTagCacheTag(var)

    }
| ### fixed tag without cache fixed: @testTagCacheTag(val) ### variable tag without cache variable: @testTagCacheTag(var)

###

###

    @verbatim(){

        fixed tag cache without parameter
        fixed: @testTagCacheTag(val).cache()

        variable tag cache without parameter
        variable: @testTagCacheTag(var).cache()

    }
| ### tag cache without parameter fixed: @testTagCacheTag(val).cache() variable: @testTagCacheTag(var).cache()

###

###

    @verbatim(){

        fixed tag cache for "2s"
        fixed: @testTagCacheTag2(val).cache("2s")

        variable tag cache for "2s"
        variable: @testTagCacheTag2(var).cache("2s")

    }
| ### fixed tag cache for "2s" fixed: @testTagCacheTag2(val).cache("2s") ### variable tag cache for "2s" variable: @testTagCacheTag2(var).cache("2s")

###

###

    @verbatim(){

        fixed tag with body no cache
        fixed: @testTagCacheTag2(val) {
        random int: @(new Random().nextInt())
        }

        variable tag with body no cache
        variable: @testTagCacheTag2(var) {
        random int: @(new Random().nextInt())
        }

    }
| ### tag with body no cache fixed: @testTagCacheTag2(val) { random int: @(new Random().nextInt()) } variable: @testTagCacheTag2(var) { random int: @(new Random().nextInt()) }

###

###

    @verbatim(){

        fixed tag with body cache no parameter
        fixed: @testTagCacheTag2(val).cache() {
        [@@testTagCacheTag2(val).cache()]random int: @(new Random().nextInt())
        }

        variable tag with body cache no parameter
        variable: @testTagCacheTag2(var).cache() {
        [@@testTagCacheTag2(var).cache()]random int: @(new Random().nextInt())
        }

    }
| ### fixed tag with body cache no parameter fixed: @testTagCacheTag2(val).cache() { [@@testTagCacheTag2(val).cache()]random int: @(new Random().nextInt()) } ### variable tag with body cache no parameter variable: @testTagCacheTag2(var).cache() { [@@testTagCacheTag2(var).cache()]random int: @(new Random().nextInt()) }

###

###

###

###

    @verbatim(){

        tag with body cache for "3s"
        fixed: @testTagCacheTag(val).cache("3s") {
        [@@testTagCacheTag(val).cache("3s")]
        random int: @(new Random().nextInt())
        }

        fixed tag with body cache for 3 seconds
        fixed: @testTagCacheTag2(val).cache(3) {
        [@@testTagCacheTag2(val).cache(3)]
        random int: @(new Random().nextInt())
        }

        fixed tag with body cache for "3s" using variable as additional cache parameter
        fixed: @testTagCacheTag2(val).cache(3, System.currentTimeMillis()) {
        [@@testTagCacheTag2(val).cache(3, System.currentTimeMillis())]
        random int: @(new Random().nextInt())
        }

        variable tag with body cache for "3s"
        variable: @testTagCacheTag2(var).cache("3s") {
        [@@testTagCacheTag2(var).cache("3s")]
        random int: @(new Random().nextInt())
        }

    }
| ### tag with body cache for "3s" fixed: @testTagCacheTag(val).cache("3s") { [@@testTagCacheTag(val).cache("3s")] random int: @(new Random().nextInt()) } ### fixed tag with body cache for 3 seconds fixed: @testTagCacheTag2(val).cache(3) { [@@testTagCacheTag2(val).cache(3)] random int: @(new Random().nextInt()) } ### fixed tag with body cache for "3s" using variable as additional cache parameter fixed: @testTagCacheTag2(val).cache(3, System.currentTimeMillis()) { [@@testTagCacheTag2(val).cache(3, System.currentTimeMillis())] random int: @(new Random().nextInt()) } ### variable tag with body cache for "3s" variable: @testTagCacheTag2(var).cache("3s") { [@@testTagCacheTag2(var).cache("3s")] random int: @(new Random().nextInt()) }

@include(tmpl_src)