First time when I tried to load data by invoking find method, the data has retrieved from shared cache. But when I attempt to retrieve the data after 5 minutes, the data has loaded from database instead of loading from shared cache. I am expecting the data to be loaded from shared cache because I set to expire the instance after 7 minutes.
Please someone let me know what could be wrong and how to resolve.
The expiry is from when the data was originally put into the cache, not the last find() operation.
When do you put the data into the cache? Are you sure you are timing things correctly? Try 1 minutes, etc.