You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Li Li <fa...@gmail.com> on 2014/02/11 10:30:42 UTC

what's the CACHE_MODULE_RESPONSE mean?

public enum CacheResponseStatus {

    /** The response was generated directly by the caching module. */
    CACHE_MODULE_RESPONSE,

    /** A response was generated from the cache with no requests sent
     * upstream.
     */
    CACHE_HIT,

    /** The response came from an upstream server. */
    CACHE_MISS,

    /** The response was generated from the cache after validating the
     * entry with the origin server.
     */
    VALIDATED;

}

when CACHE_MODULE_RESPONSE is used?

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: what's the CACHE_MODULE_RESPONSE mean?

Posted by Jon Moore <jo...@jjmoore.net>.
> On Feb 11, 2014, at 4:30 AM, Li Li <fa...@gmail.com> wrote:
> 
> public enum CacheResponseStatus {
> 
>    /** The response was generated directly by the caching module. */
>    CACHE_MODULE_RESPONSE,
> 
> ...
> 
> }
> 
> when CACHE_MODULE_RESPONSE is used?

There are only a couple of cases where this happens:

1. If you issue a request with 'Cache-Control: only-if-cached' but there is no cache entry, the caching module generates a 504 response.

2. If a cache entry is stale, is marked with 'Cache-Control: must-revalidate', and the validation request times out or has an IOException, we generate a 502 response.

There may be a couple more edge cases (I'm answering from memory), but the essence is the same: there is an actual HttpResponse being returned but it did not come from an upstream server--it was generated whole cloth by the caching module itself.

Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org