Populate different cache based on condition
How can I apply caching on a method which polupates multiple caches based on a given condition?
Or is there a work-around to apply multiple @Cacheable annotations on the same method?
The method that I want to cache fetches data from the database based on an given period. (hour, day, week, month)
I want to cache data for a day shorter than the data for a week and month.
Someone any idea how to achieve this?
I have tried to create custom annotation which has a different condition and cache declaration, but that didn't work.