15 lines
490 B
Plaintext

<c:var name="count" value="0"/>
<c:def function="foo(cacheName, cacheKey)">
<caching:cached-fragment cache-key="$cacheKey" cache-name="$cacheName">
Count: ${count++}
</caching:cached-fragment>
</c:def>
<c:invoke function="foo('cacheA', 'keyA')"/>
<c:invoke function="foo('cacheA', 'keyA')"/>
<c:invoke function="foo('cacheA', 'keyB')"/>
<c:invoke function="foo('cacheB', 'keyA')"/>
<c:invoke function="foo('cacheB', 'keyA')"/>
<c:invoke function="foo('cacheB', 'keyB')"/>