|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.cachius.spring.AbstractCacheableController
org.riotfamily.website.minify.AbstractMinifyController
public abstract class AbstractMinifyController
Controller that concatenates resources and optionally compresses or obfuscates them. The result is cached by Cachius and gzipped when possible.
The controller uses a RequestDispatcher
to request the resources
and captures them using a CapturingResponseWrapper
, which allows us
to include dynamic resources, too.
Note: This will not work if an included controller uses
request.getRequestURI()
to look up a resource. Please use
ServletUtils.getRequestUri(HttpServletRequest)
instead.
Field Summary |
---|
Fields inherited from interface org.riotfamily.cachius.spring.CacheableController |
---|
CACHE_ETERNALLY |
Constructor Summary | |
---|---|
AbstractMinifyController()
|
Method Summary | |
---|---|
protected void |
appendCacheKey(StringBuffer key,
HttpServletRequest request)
Adds the query-string to the cache-key. |
protected boolean |
bypassCache(HttpServletRequest request)
The cache is bypassed in development mode . |
protected void |
capture(String path,
ByteArrayOutputStream buffer,
HttpServletRequest request,
HttpServletResponse response)
|
protected abstract Compressor |
getCompressor()
|
protected abstract String |
getContentType()
|
long |
getLastModified(HttpServletRequest request)
Returns the server start-up time, or the current time if running in development mode . |
long |
getTimeToLive()
Returns CACHE_ETERNALLY to
request eternal caching. |
boolean |
gzipResponse(HttpServletRequest request)
Always returns true . |
ModelAndView |
handleRequest(HttpServletRequest request,
HttpServletResponse response)
|
void |
setReloadable(boolean reloadable)
If set to true , the output will not be cached,
not compressed or obfuscated and no expires header will be sent. |
Methods inherited from class org.riotfamily.cachius.spring.AbstractCacheableController |
---|
getBeanName, getCacheKey, getCacheKeyInternal, setAddUriToCacheKey, setBeanName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMinifyController()
Method Detail |
---|
public void setReloadable(boolean reloadable)
true
, the output will not be cached,
not compressed or obfuscated and no expires header will be sent.
public long getLastModified(HttpServletRequest request)
development mode
.
getLastModified
in interface CacheableController
getLastModified
in interface LastModified
getLastModified
in class AbstractCacheableController
protected boolean bypassCache(HttpServletRequest request)
development mode
.
bypassCache
in class AbstractCacheableController
protected void appendCacheKey(StringBuffer key, HttpServletRequest request)
appendCacheKey
in class AbstractCacheableController
AbstractCacheableController.getCacheKeyInternal(HttpServletRequest)
public long getTimeToLive()
CACHE_ETERNALLY
to
request eternal caching.
getTimeToLive
in interface CacheableController
getTimeToLive
in class AbstractCacheableController
public boolean gzipResponse(HttpServletRequest request)
true
.
gzipResponse
in interface Compressible
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception
handleRequest
in interface Controller
Exception
protected void capture(String path, ByteArrayOutputStream buffer, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
ServletException
IOException
protected abstract String getContentType()
protected abstract Compressor getCompressor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |