Different types of cache strategies in Hibernate

Introduction In this tutorial I will tell you different types of caches in Hibernate framework. Hibernate is an ORM (Object Relational Mapping) framework. Hibernate uses two different caches for objects: first-level cache and second-level cache. If you have queries that run over and over, with the same parameters, query caching provides performance gains. Caching introduces overhead in the area of…

Prevent Browser From Caching Resources Using Servlet Filter

Introduction In this tutorial I am going to tell you how you can prevent cache in browser using Servlet in web applications. Sometimes you may need to clear the browser cache or prevent the browser from caching resources so that users always get the latest output from the server. Disabling caching of web pages ensures resources are coming every time…

Cache static resources like css, js and images for a specific time period

Introduction In this post we will see how to cache static resources like css, js and images for a specific period of time. So we will specify the time for how long we want to cache such static resources. Static resources like css, js images etc. need not be reloaded from the server every time until and unless we want…