Cachable Static Assets with Spring MVC 1. Overview This article focuses on caching static assets (such as Javascript and CSS files) when serving them with Spring MVC. We’ll also touch on the concept of “perfect caching”, essentially making sure that – when a file is updated – the old version… Continue Reading cachable-static-assets-with-spring-mvc

Introduction to JCache 1. Overview Simply put, JCache is the standard caching API for Java. In this tutorial, we’re going to see what JCache is and how we can use it. 2. Maven Dependencies To use JCache, we need to add the following dependency to our pom.xml: <dependency> <groupId>javax.cache</groupId> <artifactId>cache-api</artifactId>… Continue Reading jcache

Introduction to Guava CacheLoader 1. Introduction In this article, we’ll introduce the Guava CacheLoader. Before reading further, it’s recommended that there is a basic understanding of the LoadingCache class first. This is because the CacheLoader works with it specifically. Essentially, the CacheLoader is a function used for computing a value… Continue Reading guava-cacheloader

Spring Cache – Creating a Custom KeyGenerator 1. Overview In this quick tutorial, we’re going to illustrate how to create a custom key generator with Spring Cache. For an introduction to the above module, please refer to this article. 2. KeyGenerator This is responsible for generating every key for each… Continue Reading spring-cache-custom-keygenerator

Spring Security – Cache Control Headers 1. Introduction In this article, we’ll explore how we can control HTTP caching with Spring Security. We’ll demonstrate its default behavior, and also explain the reasoning behind it. We’ll then look at ways to change this behavior, either partially or completely. 2. Default Caching… Continue Reading spring-security-cache-control-headers