0

I've installed lately grails cache plugin in my grails 4.0.3 application.

compile 'org.grails.plugins:cache'

I'm trying to config this to NOT clear once generated caches at application restart. This is default behavior according to the docs

My application.yml contains this part:

grails:
  cache:
    enabled: true

but every time I restart my application (moving war file) caches seems to clear. I did try to put clearAtStartup flag in my config - didn't help.

Any help would be appreciated. Thanks in advance.

bmrki
  • 371
  • 3
  • 15

1 Answers1

1

It looks like you are using the default in memory cache implementation. Since the cache is only in memory, when the application restarts the cache won't survive because the cache data is only in volatile ram.

Jeff Scott Brown
  • 26,804
  • 2
  • 30
  • 47
  • thanks for the reply. So what this `clearAtStartup` means? Is it useless? What is the scenario when it's needed? – bmrki Jul 09 '20 at 06:37
  • 1
    "So what this clearAtStartup means?" - It controls clearing caches that are stored in some cache server (not the simple in memory store), like ehcache for example. "Is it useless?" - No. "What is the scenario when it's needed?" - You would use it when you want to control whether a remote cache is cleared at startup. – Jeff Scott Brown Jul 09 '20 at 12:46