Sep 20th, 2012, 05:21 AM
Spring Cache - specify cache as optional
We have a Grails Web App, and we wanted to add a cache layer for some of the more expensive-computation calls.
After some research, we settled to the base grails cache plugin, plus the redis cache implementation.
How do you configure the cache as an optional layer? Aka - if a request comes, and does not find the cache being "up" it automatically fails over to the database and does the query? In our case, I see the cache as just an optional layer which, if it's there, should be used, but either way it should not make the web app fully dependent on it (which seems to be the default behavior). Is there a way to do this in a declarative way, or I would need to handle this programmatic?
Thanks for any suggestions.