Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/realityforge/gwt-cache-filter


https://github.com/realityforge/gwt-cache-filter

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# gwt-cache-filter

[![Build Status](https://api.travis-ci.com/realityforge/gwt-cache-filter.svg?branch=master)](http://travis-ci.com/realityforge/gwt-cache-filter)
[](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.realityforge.gwt.cache-filter%22%20a%3A%22gwt-cache-filter%22)

The project consists of two filters. The `GWTCacheControlFilter` adds the appropriate
caching attributes to GWT generated files based on *.cache.* and *.nocache.* naming
patterns. The `PreEncodedGzipFilter` will serve a gzipped variant of a static file
if one is present on the file system and the request specifies the "Accept-Encoding"
http header to include "gzip". The gzipped variant of the static file should exist
on the file system with the same name as the resource but with ".gz" suffix.

## Quick Start

The simplest way to use the library is to add the following dependency
into the build system. i.e.

```xml

org.realityforge.gwt.cache-filter
gwt-cache-filter
0.9

```

This will apply a filter across your entire application. Almost always you will want
to restrict the filter so that it only covers the gwt part of the application in which
case you should add the following snippet to web.xml;

```xml

GWTCacheControlFilter
org.realityforge.gwt.cache_filter.GWTCacheControlFilter


PreEncodedGzipFilter
org.realityforge.gwt.cache_filter.PreEncodedGzipFilter


GWTCacheControlFilter
/example/*


PreEncodedGzipFilter
/example/*

```

To get the GWT compiler to generate the gzipped files for you, the easiest way is to add
the following inherits to the ".gwt.xml" file.

```xml

```

A very simple example of this code is available in the `example` directory.