Tutorial: Using dynacache's API to not cache
This tutorial teaches you how to use the dynacache API to prevent pages and fragments from being cached. After completing this exercise, we will be able to work with cachespec.xml to define rules for cause pages and fragments not to be cached.
Learning objectives
Occasionally, it is not appropriate to cache a page that matches a caching rule, or a fragment within the cached page. In this case, the dynacache API makes it possible to ignore the cache rule and not cache the page (or fragment) in question.
Time required
Expect this tutorial to take about 20 minutes to complete.
Audience
This tutorial is intended for WebSphere Commerce Administrators who will be responsible for creating pages and fragments which would normally be cached according to caching policy but will be excluded.
Prerequisites
Publish the consumer direct sample store.
You will also need a cachespec.xml that caches the TopCategoriesDisplay page, but not the eMarketingSpot fragment of the ConsumerDirect store. You can simply comment out the entry for the eMarketingSpot fragment.
Expected results
In this tutorial, we will learn how to programmatically prevent pages and fragments from being cached, even when the cachespec.xml indicates that they should be.
Lessons in this tutorial
- Use dynacache's API to not cache a full page matching a caching rule
This section is about using dynacache's API to not cache a full page matching a caching rule.
- Use dynacache's API to not cache a fragment on a page
This section is related to using dynacache's API to not cache a fragment on a page.