In Spring Boot, we can set spring.resources.cache-period property to specify the cache period for the static resources in seconds. By default this value is zero. The value set to this property (say n) will cause the response header of Cache-Control:max-age=n to be sent to the browser.
Example
In this example, we are going to create a static page under default '/static' folder (see last tutorial for default locations).