Compressing static resources is a great way to save bandwidth and improve user experience. This is also the easiest way to speed up page loading which affects SEO in a positive way. The best and commonly used compression is GZIP. This kind of compression is disabled in Spring Boot by default but fortunately we can enable it by setting below parameters in
If you are using
YAML configuration file, these properties will look like this:
To find out if everything was correctly configured, check response headers for files choosed for compression. There should be
Content-Encoding header with
gzip value, also these files should be definitely smaller then before compression.