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....
- cachespec.xml (of REST.war)
- web.xml (of REST.war)
- cachemonitor screenshots to show the 'project' cache contents.
Prerequisites to use this code
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. )
Hope this helps!