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

[jira] [Created] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

Don Brown created HTTPCLIENT-1250:
-------------------------------------

             Summary: Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
                 Key: HTTPCLIENT-1250
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: Cache
    Affects Versions: 4.2.1
            Reporter: Don Brown


For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.

In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Don Brown commented on HTTPCLIENT-1250:
---------------------------------------

See the patch in my pull request: https://github.com/apache/httpclient/pull/1
                
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Don Brown updated HTTPCLIENT-1250:
----------------------------------

    Attachment: fix_query_caching_in_http_1_0.patch

Attaching fix that reverses the flag and makes the default behavior to cache http 1.0 responses with query strings and explicit cache headers
                
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>         Attachments: fix_query_caching_in_http_1_0.patch
>
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Oleg Kalnichevski updated HTTPCLIENT-1250:
------------------------------------------

    Fix Version/s:     (was: 4.2.2)
                   4.2.3
    
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>             Fix For: 4.2.3
>
>         Attachments: fix_query_caching_in_http_1_0.patch
>
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Don Brown commented on HTTPCLIENT-1250:
---------------------------------------

I did it this way to keep existing behavior in case folks were depending on it, but I'm fine reverting the configuration option.  Does it make sense to have this flag apply to all responses, not just HTTP 1.0 ones?
                
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Don Brown commented on HTTPCLIENT-1250:
---------------------------------------

I attached a patch that still just has special handling for HTTP 1.0, just in case.
                
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>         Attachments: fix_query_caching_in_http_1_0.patch
>
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Oleg Kalnichevski updated HTTPCLIENT-1250:
------------------------------------------

    Fix Version/s: 4.2.2

Targeting at 4.2.2
                
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>             Fix For: 4.2.2
>
>         Attachments: fix_query_caching_in_http_1_0.patch
>
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1250) Allow query string to be ignored when determining cacheability for HTTP 1.0 responses

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

Jon Moore commented on HTTPCLIENT-1250:
---------------------------------------

@don: it's possible that you've exposed a bug rather than a behavior that needs to be configured around. Section 13.9 of RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.9
is a little ambiguous for me, as your additional unit test highlights. I think the question is: if a 1.0 origin puts explicit cacheability markers on a request (Expires, Last-Modified, Cache-Control) with a query component, are you allowed to cache it?

Caching them is definitely at least conditionally compliant (since the HTTP/1.0 restriction is just a SHOULD NOT), and in fact the httpbis clarification indicates the restriction isn't widely implemented: http://tools.ietf.org/html/draft-ietf-httpbis-p6-cache-21#section-4.1.2

So I'd actually like to suggest that we modify your patch so that it caches queries with explicit cacheability by default, and have the opt-in behavior be to turn off caching for those 1.0 queries.

Also, small point of administrivia: official patches have to get posted to JIRA; the github version of httpclient is just a mirror of the official SVN repository right now.

Would you mind making the above change and then submitting a patch and further comments against the JIRA issue here?

Thanks.
                
> Allow query string to be ignored when determining cacheability for HTTP 1.0 responses
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1250
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1250
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.2.1
>            Reporter: Don Brown
>
> For HTTP 1.0 responses, the cache uses a heuristic that checks for the presence of a query string, and if found, disables caching regardless of any explicit cache headers.  This should be configurable to allow a client to disable this heuristic.
> In my case, I have a squid proxy in front of my server that is turning all responses into HTTP 1.0 responses, and thereby, disabling the cache for all outgoing requests that involve a query string.  Ignoring the query string will work great for me as I use the cache in a controlled environment where the caching behavior is documented and understood by clients.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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