knorv
knorv

Reputation: 50127

What are some good examples when the default Grails cache settings should be tweaked?

These are the default Hibernate settings in Grails (found in conf/DataSource.groovy):

hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}

What are some good examples of circumstances under which one would like to:

Upvotes: 3

Views: 513

Answers (2)

Maricel
Maricel

Reputation: 2089

In our project we are using the Datasources plug in to be able to connect to another database. This database is managed by another system, so we can't cache these classes because we don't have a way to know when they are updated, so for this datasource we disabled the second-level cache and the query cache. Just an example.

Upvotes: 2

mfloryan
mfloryan

Reputation: 7685

It is difficult to give generic guidance on using cache as the best approach IMHO is always to build some metrics for the system and validate the effect cache has on those metrics.

I assume you realise that despite the above default settings in grails no queries or results are cached at all by default as cache is only used when explicitly enabled for specific queries/associations.

Upvotes: 3

Related Questions