Fragment caching for JSP and Spring MVC — inside your own JVM.

Add a servlet filter, set response headers, and Frontcache caches the fragments of a page. The one block that has to be live no longer forces the whole page to render.

  • In-process or in front. A servlet filter inside your app, or a standalone reverse proxy in front of it — same engine, same headers.
  • Per-fragment TTLs. <fc:include> fragments resolve in parallel, each with its own lifetime and invalidation tags.
  • Personal blocks stay live. Cache the page shell and the catalog; the cart or account fragment simply sets no TTL and renders every time.
  • Fallbacks when the origin fails. Every origin call is guarded by a circuit breaker; a failing URI pattern gets content you wrote instead of an error page.
41.3 → 1.6 ms

median response time, measured on a replay of 100,000 production requests — cache on vs. off, same app, same machine; 6.1× the throughput at the same concurrency. How it was measured

See it on your JVM — 45 minutes with an engineer

$200, credited toward a Cacheability Assessment or Pro. Servlet filter or reverse proxy, on your own pages.

1. Pick a time

Times are in your time zone.

Loading open times…

2. About you

Reschedule free up to 24 hours before by replying to the confirmation email; if we cancel, you get a full refund; a session missed without notice is not refunded. Payment by PayPal — privacy policy.

Not ready for a call? Send us an access log for a free first look.

A Filter, Two Headers, and Includes

Frontcache caches nothing until your application says so. Cacheability is a property of the response, declared by the code that knows what the response means — not a rule list someone has to maintain in a separate tier.

A page becomes a shell plus <fc:include> fragments. Each fragment is its own request with its own TTL: the header and the catalog can live for an hour, the recommendations for five minutes, and the mini-cart not at all. Fragments that miss are fetched in parallel and stitched into the response.

Invalidate by URL pattern or by tag — one product update clears every fragment tagged product-42, on every page that includes it.

Requirements: filter mode needs Java 25 and Jakarta EE 10 (Servlet 6.0) — Spring Boot 3.x. On an older JVM or a javax.servlet container, run Frontcache as a standalone reverse proxy in front of the app instead: it carries its own runtime, and your app only has to set response headers. Builds for Java 17 and 21 are on our roadmap.

repositories {
    mavenCentral()
    maven { url = 'https://repo.eternita.co/maven2' }
}
dependencies {
    implementation 'org.frontcache:frontcache-core:2.12.0'
    implementation 'org.frontcache:frontcache-agent:2.12.0'
}

Gradle; Maven works the same way. Configuration comes from a FRONTCACHE_HOME directory, shipped as frontcache-core-2.12.0-home.zip.

@Bean
FilterRegistrationBean<FrontcacheFilter> frontcacheFilter() {
    var reg = new FilterRegistrationBean<>(new FrontcacheFilter());
    reg.addUrlPatterns("/example/*");
    reg.setName("FrontcacheFilter");
    reg.setOrder(1);
    return reg;
}

Spring Boot registration. A plain web.xml <filter> mapping works too.

<%@ taglib uri="http://frontcache.org/core" prefix="fc" %>
<fc:component maxage="1h" tags="catalog|product-42" />
<fc:include url="/common/header.jsp" />
<fc:include url="/store/product-details-42" />
<fc:include url="/account/mini-cart" />  <%-- sets no maxage: always live --%>

Not JSP? Any controller can set the same thing as headers: x-frontcache-component-maxage: 1h and x-frontcache-component-tags: catalog|product-42.

The App Servers Left. The Apps Stayed.

Fragment caching inside a Java application used to be the app server’s job. Those products are legacy or gone; the JSP and Spring MVC applications that relied on them are still in production.

WebSphere DynaCache

Servlet and JSP fragment caching inside the app server, configured in cachespec.xml and tied to WebSphere. Frontcache keeps the in-process model and the fragment-level invalidation — as tags — on any Jakarta servlet container.

OSCache

JSP tag-based fragment caching, abandoned around 2007. <fc:component> and <fc:include> play the same role, with per-fragment TTLs, tags, and parallel resolution of includes.

Whole-page caching filters

A filter that caches whole responses — such as Ehcache’s page-caching filter — has to skip any page with one personal block on it. Caching fragments instead is what lets those pages cache at all.

Your Edge Logic as a Jar, Not a VCL File

Since 2.13.0 a Frontcache node runs plugins: Java code, built against an Apache-2.0 plugin API and tested with a public testkit. A plugin can react to what happened (a rule matched, the origin failed), serve a page of its own under /fc-x/, run in the background, or add a condition your guard rules can use — !ext:geo:country=DE,FR.

It ships as a jar in the node’s plugins/ directory, enabled by name and pinned by its SHA-256. A plugin that fails to start is a plugin that is absent: the node starts without it. The Pro features are plugins on the same API.

Start from the plugin template, or have us write it.

dependencies {
    compileOnly        'org.frontcache:frontcache-plugin-api:2.13.0'
    testImplementation 'org.frontcache:frontcache-plugin-testkit:2.13.0'
}
# src/main/resources/META-INF/frontcache-plugin.properties
id         = geo
class      = com.example.GeoPlugin
version    = 1.0.0
plugin-api = 1
kinds      = decide

The testkit runs your plugin in-process with the node’s own checks: its manifest, start/stop/start, and every condition it adds — never throwing, and within its time budget.

What the Benchmark Shows — and What It Doesn’t

A replay of 100,000 real production requests against a live app, run twice back to back: once with the cache on, once with it switched off. Same app, same machine, same request stream, byte-identical responses.

98.7% Fewer origin renders (79,900 → 1,003)
41.3 → 1.6 ms Median response time
6.1× Throughput, same concurrency

Whose site

hobbyray.com, a site we operate. The mechanism generalizes; the exact multiplier does not.

Whose hit ratio

98.7% is that replay’s working set — a hot set by construction. Over the site’s full 681k-request log the same harness measures about 66.7%. Yours will depend on your TTLs and traffic shape.

What got worse

The worst case. p99 improved only 42% and the single slowest request got slower: the uncached remainder queues behind 6× the throughput. Size the origin for that fraction.

What It Caches, and Where It Sits

A short introduction — what Frontcache caches, and where it sits in the request path (5 mins)

See It Running

Frontcache in production — a walkthrough of the cache features running in front of hobbyray.com (13 mins)

Get Your Own Numbers Before You Change Anything

Start with 45 minutes with an engineer on your own JVM — $200, credited toward the Assessment, which replays your traffic against your app and tells you the hit ratio, the fragment plan, and the saving.