Overview

This plugin provides an add-on to deal with HTTP caching.

Have a look at the HTTP caching section of the documentation for all the information about this topic.

Installation

If you use the spincast-default artifact and the standard Bootstrapper, this plugin is already installed by default so you have nothing to do!

If you start from scratch, using the spincast-core artifact, you can use the plugin by :

1. Adding this Maven artifact to your project:

<dependency>
    <groupId>org.spincast</groupId>
    <artifactId>spincast-plugins-http-caching</artifactId>
    <version>2.2.0</version>
</dependency>

2. Installing the provided SpincastHttpCachingPluginModule module to your Guice context.

Plugin class

The class implementing the SpincastPlugin interface is SpincastHttpCachingPlugin.

Suggested add-on

Example :

public void myHandler(AppRequestContext context) {
    
    // Sends a "Cache-Control" header
    context.cacheHeaders().cache(60);
}

This add-on is already installed by default on the Request Context type.

Javadoc