Application tier in the enterprise architecture is specialized to carry an important perhaps complex role in overall response preparation. For ADF applications or Composite SOA applications, it is important and wise decision to use multi-level caching solutions.
- Use the Web-tier caching for all static content such as images and html and ESI includes (if is needed and cost is not a criteria)
- Use ADF caching in the application layer
- Use Data caching at the database layer
Today, I will cover the ADF Caching solution by using the ADF Cache tag
Step-1: Add the ADF Faces Cache Library (afc.jar) to your project
Step-2: Add xmlns:afc="http://xmlns.oracle.com/adf/faces/webcache" to the
Step-3: Now add the
index.jspx
<f:view>
<afc:cache duration="”3600”"><!--1 Hour-->
<!-- resource intensive cacheable content/fragment -->
</afc:cache>
</f:view>
Step-4: Now Run the Jspx in the Jdev environment to see the logging to know whether the fragment is cached or not. You may see a cache miss for the first time and is normal as the first request builds the cache and is available from there after.
Depends on the complexity of the page view the second request is 1-10 times faster when using the adf cache tag.
Now, it's your turn to try it.
No comments:
Post a Comment