
templates.plugins.spincast-http-caching.spincast-http-caching.html Maven / Gradle / Ivy
Show all versions of spincast-website Show documentation
{% extends "../../layout.html" %}
{% block sectionClasses %}plugins hasBreadCrumb plugins-spincast-http-caching{% endblock %}
{% block meta_title %}Plugins - Spincast HTTP Caching{% endblock %}
{% block meta_description %}Spincast HTTP Caching plugin : ETag, Cache-Control, etc.{% endblock %}
{% block scripts %}
{% endblock %}
{% block body %}
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>{{spincast.spincastCurrrentVersion}}</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
-
Name :
cacheHeaders()
-
Component : CacheHeadersRequestContextAddon
-
Usage : to allows your
Route Handlers
control over the various HTTP caching mecanisms.
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
{% endblock %}