Cache

Introduction to JCache JSR 107

Caching libraries such as Ehcache, Hazelcast, Infinispan, GridGain, Apache Ignite in the Java ecosystem are common and indeed is needed in many different kinds of solutions to optimize the application in various ways. The simplest libraries are just in-memory object maps with simple evict rules, while the most advanced caching libraries have efficient cross-JVM features […]

Ehcache implementation using Spring framework

The terms “buffer” and “cache” tend to be used interchangeably; note however they represent different things. A buffer is used traditionally as an intermediate temporary store for data between a fast and a slow entity. As one party would have to wait for the other affecting performance, the buffer alleviates this by allowing entire blocks […]

Second Level OSCache example in Hibernate

This tutorial will sow how we can configure second level cache using OSCache in Hibernate step by step. We know that there are three types of caching mechanism in Hibernate such as First Level – Session, Second Level – SessionFactory and Query Level – SessionFactory. For more information on First Level, Second Level and Query […]

Second level EHCache example in Hibernate

This tutorial will sow how we can configure second level cache using ehcache in Hibernate step by step. EH stands for Easy Hibernate. We know that tehre are three types of caching mechanism such as First Level – session, Second Level – SessionFactory and Query Level – SessionFactory. For more information on First Level, Second […]

Different types of cache strategies in Hibernate

Hibernate uses two different caches for objects: first-level cache and second-level cache. First-level cache is associated with the Session object, while second-level cache is associated with the SessionFactory object. By default, Hibernate uses first-level cache on a per-transaction basis. Hibernate uses this cache mainly to reduce the number of SQL queries it needs to generate […]

Prevent browser from caching resources

Sometimes we need to clear the browser cache or prevent the browser from caching resources so that we always get the latest output from the server. Disabling caching of your webpages ensures your resources come from the server each and every time. In every browser, you’ll find the option to disable caching or even you can […]

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 […]

Scroll to top