CacheControl interface represents cache settings
for a piece of markup. The settings are only valid for the current
request.
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the ETag for the current response that is used as validation tag, ornull
if no ETag is set.Returns the ETag for the current response that is
used as validation tag, or |
| public int | Returns: the currently set expiration time in seconds; 0 indicates caching is disabled for this portlet; -1 indicates the cache does not expire.Get the currently set expiration time. |
| public boolean | Returns: true if the cache scope is public for the current response.Returns a boolean indicating whether the caching scope is set to public for the current response. |
| public void | |
| public void | setExpirationTime(int
expiration time in seconds time)Sets a new expiration time for the current response in seconds. |
| public void | setPublicScope(boolean
indicating if the cache entry can be shared across users publicScope)Sets the caching scope for the current response
to public with |
| public void | setUseCachedContent(boolean
boolean indication whether the
the cached content is still valid or not useCachedContent)Sets the indication whether the cached content for the provided ETag at the request is still valid or not. |
| public boolean | Returns: boolean indicating whether the caching scope is set to public for the current responseReturns a boolean indicating whether the cached content for the provided ETag at the request can still be considerated valid. |
| getETag | back to summary |
|---|---|
| public String getETag() Returns the ETag for the current response that is
used as validation tag, or
This call is equivalent to calling
| |
| getExpirationTime | back to summary |
|---|---|
| public int getExpirationTime() Get
the currently set expiration time.
If no expiration time has been
explicitly set on this response, the default defined in the portlet
deployment descriptor with the
This call returns the same value as the
| |
| isPublicScope | back to summary |
|---|---|
| public boolean isPublicScope() Returns a boolean indicating whether the
caching scope is set to public for the current response.
If no caching scope is set on this response, the default
defined in the deployment descriptor with the
Public cache scope indicates that the cache entry can be shared across users. Non-public, or private cache scope indicates that the cache entry must not be shared across users.
This call is equivalent to calling
| |
| setETag | back to summary |
|---|---|
| public void setETag(String token) Sets an ETag for the current response that is used as validation tag. If an ETag was already set it is replaced with the new value.
This call is equivalent to calling
Setting the ETag to
| |
| setExpirationTime | back to summary |
|---|---|
| public void setExpirationTime(int time) Sets a new expiration time for the current response in seconds. If the expiration value is set to 0, caching is disabled for this portlet; if the value is set to -1, the cache does not expire.
This call is equivalent to calling
| |
| setPublicScope | back to summary |
|---|---|
| public void setPublicScope(boolean publicScope) Sets the caching scope for the current response
to public with Public cache scope indicates that the cache entry can be shared across users. Non-public, or private cache scope indicates that the cache entry must not be shared across users.
This call is equivalent to calling
| |
| setUseCachedContent | back to summary |
|---|---|
| public void setUseCachedContent(boolean useCachedContent) Sets the indication whether the cached content
for the provided ETag at the request is still valid or not.
If set to
This call is equivalent to calling
| |
| useCachedContent | back to summary |
|---|---|
| public boolean useCachedContent() Returns a boolean indicating whether the
cached content for the provided ETag at the request
can still be considerated valid.
If not set, the default is
This call is equivalent to calling
| |