public interface ICacheHeadersRequestContextAddon<R extends IRequestContext<?>>
| Modifier and Type | Method and Description |
|---|---|
ICacheHeadersRequestContextAddon<R> |
cache(int seconds)
The number of seconds the client should cache this resource
before requesting it again.
|
ICacheHeadersRequestContextAddon<R> |
cache(int seconds,
boolean isPrivate)
The number of seconds the client should cache this resource
before requesting it again.
|
ICacheHeadersRequestContextAddon<R> |
cache(int seconds,
boolean isPrivate,
Integer secondsCdn)
The number of seconds the client should cache this resource
before requesting it again.
|
ICacheHeadersRequestContextAddon<R> |
eTag(String currentTag)
Specifies the current ETag (strong) of the resource.
|
ICacheHeadersRequestContextAddon<R> |
eTag(String currentTag,
boolean currentTagIsWeak)
Specifies the current strong or weak ETag of the resource.
|
ICacheHeadersRequestContextAddon<R> |
eTag(String currentTag,
boolean currentTagIsWeak,
boolean weakComparison)
Specifies the current strong or weak ETag of the resource.
|
ICacheHeadersRequestContextAddon<R> |
lastModified(Date lastModificationDate)
Specifies the last modification date of the resource.
|
ICacheHeadersRequestContextAddon<R> |
noCache()
Sends "No Cache" headers so the resource is not cached
at all by the client.
|
boolean |
validate(boolean resourceCurrentlyExists)
Call this when you are done setting
ETag and/or Last-Modified to validate
them agains the headers sent by the client. |
ICacheHeadersRequestContextAddon<R> eTag(String currentTag)
A strong comparison will be used to compare the request ETag to this current ETag.
Skip, or use null if the resource doesn't exist.
ICacheHeadersRequestContextAddon<R> eTag(String currentTag, boolean currentTagIsWeak)
A strong comparison will be used to compare the request ETag to this current ETag.
Skip, or use null if the resource doesn't exist.
ICacheHeadersRequestContextAddon<R> eTag(String currentTag, boolean currentTagIsWeak, boolean weakComparison)
Skip, or use null if the resource doesn't exist.
weakComparison - should a weak comparison be used instead of
a strong one to compare the request ETag to the current ETag?ICacheHeadersRequestContextAddon<R> lastModified(Date lastModificationDate)
Skip, or use null if the resource doesn't exist.
ICacheHeadersRequestContextAddon<R> cache(int seconds)
ICacheHeadersRequestContextAddon<R> cache(int seconds, boolean isPrivate)
isPrivate - should the cache be 'private'?
(help)ICacheHeadersRequestContextAddon<R> cache(int seconds, boolean isPrivate, Integer secondsCdn)
isPrivate - should the cache be 'private'?
(help)secondsCdn - The number of seconds the resource associated with
this route should be cached by a CDN/proxy. If null, it
won't be used.ICacheHeadersRequestContextAddon<R> noCache()
boolean validate(boolean resourceCurrentlyExists)
ETag and/or Last-Modified to validate
them agains the headers sent by the client.
If this method returns true, the route handler should return immediately
without returning/creating/modifying/deleting the associated resource! Appropriate headers
have already been set on the response.
resourceCurrentlyExists - Does the resource currently exist?Copyright © 2016. All rights reserved.