response_cache v0.0.1 PlugResponseCache.Profiles.Default View Source

Link to this section Summary

Functions

Determines whether or not the request should be cached or retrieved from the cache. This callback gets executed before the request is handled by your application

Determines whether or not the request should be cached. This callback gets executed after the request is handled by your application

Returns the expiration time of the cached response in the UTC timezone. Returns a :never atom. If the response shouldn’t expire automatically

Link to this section Functions

Link to this function cache_request?(conn, options) View Source

Determines whether or not the request should be cached or retrieved from the cache. This callback gets executed before the request is handled by your application.

The default profile checks the request type here, since it only caches “GET” requests.

Callback implementation for PlugResponseCache.Profile.cache_request?/2.

Link to this function cache_response?(conn, options) View Source

Determines whether or not the request should be cached. This callback gets executed after the request is handled by your application.

The default profile checks the response code here, since it only caches successful responses.

Callback implementation for PlugResponseCache.Profile.cache_response?/2.

Returns the expiration time of the cached response in the UTC timezone. Returns a :never atom. If the response shouldn’t expire automatically.

Callback implementation for PlugResponseCache.Profile.expires/2.