Using Spring Cache as the Thymeleaf Cache

Thymeleaf includes caching that can be used to cache templates, fragments, messages, and expressions. The default implementation is an in-memory cache using standard Java collections. Wouldn’t it be nice to use the Spring Cache Abstraction instead? The advantages of such a setup include: Consistency – why have many separate caching implementations each configured in different … Continue reading Using Spring Cache as the Thymeleaf Cache

Improving Performance of Spring’s ShallowEtagHeaderFilter by 50%

I led the team developing a new web presence for Mackenzie Financial, an effort which involved performance testing (which is always a good practice). During that testing, I discovered that ShallowEtagHeaderFilter was generating a lot of garbage and a lot of time was being spent in it. That didn’t seem ideal so I dove in … Continue reading Improving Performance of Spring’s ShallowEtagHeaderFilter by 50%

HTTP Response Caching for Java and Android

HTTP caching is both important, as it reduces bandwidth use and improves performance, and complex, as the rules are far from simple. In my experience, most Java and Android applications either don’t do HTTP caching, or they roll their own and up doing it wrong or in way too complicated a fashion. In other words, … Continue reading HTTP Response Caching for Java and Android

Best way to use HttpClient in Android

Many Android applications access the Internet resources over HTTP (and my projects are no exception). There are 2 common ways to do that: use Apache HttpClient 4.x (which is included in Android) or use HttpURLConnection (from Java). Google stated in a September 29, 2011 blog post that they prefer you use HttpURLConnection, but many apps … Continue reading Best way to use HttpClient in Android

Compression (deflate) and HTML, CSS, JS Minification in ASP.NET

As I’ve already demonstrated, I like performance. So I cache and compress a lot. When I was put onto an ASP.NET project at work, I obviously wanted to optimize the site, so here’s what I did. Taking some hints from Y! Slow, I decided I wanted to: Get rid of all the MS AJAX/toolkit javascript, … Continue reading Compression (deflate) and HTML, CSS, JS Minification in ASP.NET

EhCache implementation of OpenJPA caching

I usually use Hibernate, which supports a number of caching implementations (such as EhCache, oscache, JBoss, etc). My most recent project had a dependency on a product which has a dependency on OpenJPA, and OpenJPA only has it’s own built in implementations of a query cache and a data cache. I like to have one … Continue reading EhCache implementation of OpenJPA caching