You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Felix Berger (JIRA)" <ji...@apache.org> on 2010/10/12 20:23:33 UTC

[jira] Created: (HTTPCLIENT-1010) add an X-From-Cache header to responses that are served from the cache

add an X-From-Cache header to responses that are served from the cache
----------------------------------------------------------------------

                 Key: HTTPCLIENT-1010
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1010
             Project: HttpComponents HttpClient
          Issue Type: New Feature
          Components: Cache
    Affects Versions: 4.1 Alpha2
            Reporter: Felix Berger
         Attachments: x-from-cache.patch

This allows the caller to find out if an actual connection has been made. One possible way of doing this is to add a custom header to resonses generated from the cache. The attached patch adds the header:

X-From-Cache: true

The use case where this is needed is when you want to know whether you are actually connected to the internet or whether contacted server is alive without generating extra out of order requests.

I was also looking if it was possible to detect this by looking at the Via header, but it looks like the same header is added whether the response is served from the backend or the local cache.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-1010) add an X-From-Cache header to responses that are served from the cache

Posted by "Felix Berger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Berger updated HTTPCLIENT-1010:
-------------------------------------

    Attachment: x-from-cache.patch

Patch addding X-From-Cache header.

> add an X-From-Cache header to responses that are served from the cache
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1010
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1010
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Felix Berger
>         Attachments: x-from-cache.patch
>
>
> This allows the caller to find out if an actual connection has been made. One possible way of doing this is to add a custom header to resonses generated from the cache. The attached patch adds the header:
> X-From-Cache: true
> The use case where this is needed is when you want to know whether you are actually connected to the internet or whether contacted server is alive without generating extra out of order requests.
> I was also looking if it was possible to detect this by looking at the Via header, but it looks like the same header is added whether the response is served from the backend or the local cache.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-1010) add an X-From-Cache header to responses that are served from the cache

Posted by "Jonathan Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920289#action_12920289 ] 

Jonathan Moore commented on HTTPCLIENT-1010:
--------------------------------------------

Hi Felix,

There's a related (previous) issue where this was solved by setting a variable in an HttpContext that's passed in; the header approach was discussed there as well.

https://issues.apache.org/jira/browse/HTTPCLIENT-982

Jon

> add an X-From-Cache header to responses that are served from the cache
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1010
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1010
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Felix Berger
>         Attachments: x-from-cache.patch
>
>
> This allows the caller to find out if an actual connection has been made. One possible way of doing this is to add a custom header to resonses generated from the cache. The attached patch adds the header:
> X-From-Cache: true
> The use case where this is needed is when you want to know whether you are actually connected to the internet or whether contacted server is alive without generating extra out of order requests.
> I was also looking if it was possible to detect this by looking at the Via header, but it looks like the same header is added whether the response is served from the backend or the local cache.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Closed: (HTTPCLIENT-1010) add an X-From-Cache header to responses that are served from the cache

Posted by "Felix Berger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Berger closed HTTPCLIENT-1010.
------------------------------------

    Resolution: Duplicate

> add an X-From-Cache header to responses that are served from the cache
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1010
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1010
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Felix Berger
>         Attachments: x-from-cache.patch
>
>
> This allows the caller to find out if an actual connection has been made. One possible way of doing this is to add a custom header to resonses generated from the cache. The attached patch adds the header:
> X-From-Cache: true
> The use case where this is needed is when you want to know whether you are actually connected to the internet or whether contacted server is alive without generating extra out of order requests.
> I was also looking if it was possible to detect this by looking at the Via header, but it looks like the same header is added whether the response is served from the backend or the local cache.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-1010) add an X-From-Cache header to responses that are served from the cache

Posted by "Felix Berger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920294#action_12920294 ] 

Felix Berger commented on HTTPCLIENT-1010:
------------------------------------------

Ah great, I should be able to make that work for me. Closing this issue then.

> add an X-From-Cache header to responses that are served from the cache
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1010
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1010
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Felix Berger
>         Attachments: x-from-cache.patch
>
>
> This allows the caller to find out if an actual connection has been made. One possible way of doing this is to add a custom header to resonses generated from the cache. The attached patch adds the header:
> X-From-Cache: true
> The use case where this is needed is when you want to know whether you are actually connected to the internet or whether contacted server is alive without generating extra out of order requests.
> I was also looking if it was possible to detect this by looking at the Via header, but it looks like the same header is added whether the response is served from the backend or the local cache.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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