final class CachedBuilder extends AnyRef
Builds an action with caching behavior. Typically created with one of the methods in the Cached
class. Uses both server and client caches:
- Adds an
Expires
header to the response, so clients can cache response content ; - Adds an
Etag
header to the response, so clients can cache response content and ask the server for freshness ; - Cache the result on the server, so the underlying action is not computed at each call.
- Source
- Cached.scala
- Alphabetic
- By Inheritance
- CachedBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
CachedBuilder(cache: AsyncCacheApi, key: (RequestHeader) ⇒ String, caching: PartialFunction[ResponseHeader, Duration])(implicit materializer: Materializer)
- cache
The cache used for caching results
- key
Compute a key from the request header
- caching
A callback to get the number of seconds to cache results for
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(action: EssentialAction): EssentialAction
Compose the cache with an action
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
build(action: EssentialAction): EssentialAction
Compose the cache with an action
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compose(alternative: PartialFunction[ResponseHeader, Duration]): CachedBuilder
Compose the cache with new caching function
Compose the cache with new caching function
- alternative
a closure getting the reponseheader and returning the duration we should cache for
-
def
default(duration: Int): CachedBuilder
The returned cache will store all responses whatever they may contain
The returned cache will store all responses whatever they may contain
- duration
the number of seconds we should store responses
-
def
default(duration: Duration): CachedBuilder
The returned cache will store all responses whatever they may contain
The returned cache will store all responses whatever they may contain
- duration
how long we should store responses
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
includeStatus(status: Int, duration: Duration): CachedBuilder
Whether this cache should cache the specified response if the status code match This method will cache the result for duration seconds
Whether this cache should cache the specified response if the status code match This method will cache the result for duration seconds
- status
the status code to check
- duration
how long should we cache the result for
-
def
includeStatus(status: Int, duration: Int): CachedBuilder
Whether this cache should cache the specified response if the status code match This method will cache the result for duration seconds
Whether this cache should cache the specified response if the status code match This method will cache the result for duration seconds
- status
the status code to check
- duration
the number of seconds to cache the result for
-
def
includeStatus(status: Int): CachedBuilder
Whether this cache should cache the specified response if the status code match This method will cache the result forever
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()