When should one use the following?
static mapping = {
cache true
}
I am tempted to add it to my domain classes User, UserRole and Role.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should cache after you have profiled your application and determined that caching information (such as your domain classes) would benefit your application. Data that is read only or changed very rarely should be considered for cache as long as it has a high usage.
The key is, profile your application, and only after that plan for caching where it makes sense. Don’t just cache because it’s available to you.