0

What I want to do is refreshing the view on back key. So that my user can see updated page.

So I tried to disable cache by adding:

spring.resources.cache.cachecontrol.no-cache=true

However, it doesn't work.

John
  • 836
  • 10
  • 23
  • 1
    I'm fairly certain that browsers will load a cached version regardless of your cache control header configuration if you use the browser history (eg. a back button). JavaScript code is still executed though, and by creating a proper event listener, you should be able to reload a page in case you're using the back button, as mentioned in [this question](https://stackoverflow.com/questions/43043113/how-to-force-reloading-a-page-when-using-browser-back-button). – g00glen00b Mar 08 '19 at 09:26

1 Answers1

2

You can specify which cache type to use by adding spring.cache.type to your configuration. To disable it set the value to NONE.

spring.cache.type=NONE
Patel Romil
  • 9,276
  • 7
  • 27
  • 56