Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-04-18T10:11:54Z by YashbirSachdev
KiranYayavaram
KiranYayavaram
45 Posts
ACCEPTED ANSWER

Pinned topic REST services caching for custom Nouns

‏2012-12-30T16:53:18Z |
Hi,

I have noticed this one thing related to REST services server-side caching for custom Nouns, does not have proper documentation yet on Infocenter. So I poked around & put together this small documentation for sharing with few more people. I am sure, IBM will be providing with more proper documentation for this topic.

Some of you might have already found out a way to get around this constraint. so, I appreciate if you can leave your comments & feedback.

What does OOB offer & what is the existing limitation...
  • RESTCacheFilter handles the server-side caching for REST services. It has hard-coded Nouns in it & doe not handle for custom Nouns. So in order to support for custom Nouns we have to write our own custom CacheFilter.

What is present in the attachment....
  • RestCacheFilterExt.java
  • cachespec.xml (of REST.war)
  • web.xml (of REST.war)
  • cachemonitor screenshots to show the 'project' cache contents.

Prerequisites to use this code
  • Require the IBM tutorials to have completed link1 & link2

Notes about the code
  • Updated web.xml to use my custom cache filter
  • My code does not handle OOB Nouns i.e. productview,categoryview,espot. These are already existing in OOB RESTCacheFilter. So i did not want to copy paste it ( I am hoping IBM will provide some extension points to overcome this )
  • My goal was just to see my custom cache filter working for custom noun: project. So I have not yet spend time on cache invalidations for custom REST services. Since they all are old concepts, I presuming they all should work fine.
  • I have written this RestCacheFilterExt.java, based on the 'Project' noun that will be created after those tutorials.
  • I had to copy-paste some lines of code from OOB RESTCacheFilter ( Looking for your feedback on this, if there is better way to handle, let me know. )
Again, looking forward to read your feedback on the approach. Share your ideas if there are issues in the code or if there is a better way.

Hope this helps!