You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Xiao Feng Yu (JIRA)" <ji...@apache.org> on 2012/04/25 17:36:17 UTC

[jira] [Created] (SHINDIG-1759) Shindig returns the response that should not be cached

Xiao Feng Yu created SHINDIG-1759:
-------------------------------------

             Summary: Shindig returns the response that should not be cached
                 Key: SHINDIG-1759
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
             Project: Shindig
          Issue Type: Bug
          Components: Java
    Affects Versions: 3.0.0
            Reporter: Xiao Feng Yu


We recently find a issue with Shindig cache. The problem can be happens with the following conditions
1) Client perform a makeRequest call with refresh equals 0.
2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
3) The web resource server returns the resource with Cache-Control header set to no-cache.
When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Created] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by Dan Dumont <dd...@us.ibm.com>.
I'm not sure what's going on.

I made sure I was up to date, updated my project configurations, forced 
maven to download deps, made sure all my local changes were reverted.
Then I did a maven clean, and built with debug output on.   I got no 
failures at all.   :(



From:   Henry Saputra <he...@gmail.com>
To:     dev@shindig.apache.org, 
Date:   04/30/2012 02:05 PM
Subject:        Re: [jira] [Created] (SHINDIG-1759) Shindig returns the 
response that should not be cached



Dan,

Could you check if the check-in for this fix is breaking some end to end 
tests:

https://builds.apache.org/view/S-Z/view/Shinding/job/Shindig/2777/#showFailuresLink


- Henry

On Wed, Apr 25, 2012 at 8:36 AM, Xiao Feng Yu (JIRA) <ji...@apache.org> 
wrote:
> Xiao Feng Yu created SHINDIG-1759:
> -------------------------------------
>
>             Summary: Shindig returns the response that should not be 
cached
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>
>
> We recently find a issue with Shindig cache. The problem can be happens 
with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the 
clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control 
header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get 
the response correctly, and then the second user B performs the same 
makeRequest call, Shindig returns the cached response. But in fact, it 
should not, because refresh equals 0 is specified and Cache-Control: 
no-cache is present in the response.
> The reason is beause refresh equals 0 will override the 
cache-control:no-cache header in response with 
Cache-Control:public,max-age=0 header. And the next time, the cached 
response retrieved, the TTL of the cached response will be calculated by 
Date header. And because of the clock skew (Shindig only fix the time 
drift larger than 3 minutes), it leaves a time window in which the cached 
response will be returned, while it should not be.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA 
administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: 
http://www.atlassian.com/software/jira
>
>



Re: [jira] [Created] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by Henry Saputra <he...@gmail.com>.
Dan,

Could you check if the check-in for this fix is breaking some end to end tests:

https://builds.apache.org/view/S-Z/view/Shinding/job/Shindig/2777/#showFailuresLink

- Henry

On Wed, Apr 25, 2012 at 8:36 AM, Xiao Feng Yu (JIRA) <ji...@apache.org> wrote:
> Xiao Feng Yu created SHINDIG-1759:
> -------------------------------------
>
>             Summary: Shindig returns the response that should not be cached
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263295#comment-13263295 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------



bq.  On 2012-04-26 14:56:26, BrianLillie wrote:
bq.  > As noted in the JIRA, the issue with the no-cache being returned on the first request, and the (incorrect) cached response on the second request occurs due to the modification of the cached response in the AbstractHttpCache.addResponse.   This code slams the request's refresh interval onto the cache-control headers, and puts that into the cache, while the original request with no-cache is returned to the user.   It seems like this fix would address only one specific issue, that of an incoming request with refresh interval = 0.   If the refresh interval specified  by the client is sufficiently smaller than the time skew between the two servers, wouldn't the same issue occur ?
bq.  
bq.  Dan Dumont wrote:
bq.      Hmmm...  
bq.      
bq.      In my experience a max-age on a cache response indicates the maximum period of time before you should toss out the whole cached object and ask again.  Not that you shouldn't ask until you've hit the max-age (which i thought what expires was for).
bq.      
bq.      So should we treat all responses as stale if they come back with max-age so that we can ask with a last-modified query?  I think this is what browsers do.
bq.  
bq.  BrianLillie wrote:
bq.      My interpretation of the HTTP 1.1 spec
bq.       - max-age - you are allowed to reuse without validating until the time expires
bq.       - expires - supposed to be deprecated via 1.1 spec, with cache-control taking precedence .. though of course browsers will do what they will
bq.       - no-cache - can't use the response for caching without re-validating with the server first
bq.      
bq.      Based on that, max-age shouldn't be treated as stale until the time expires

It is possible if the max-age value is sufficiently smaller than the time skew which is maximum to be 3 minutes by default (otherwise Shindig will take the time on Shindig server). But in rare case it would happen in real world - when the server specified max-age, the common value would be in hours or 0.  


- Xiao Feng


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7263
-----------------------------------------------------------


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263858#comment-13263858 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7314
-----------------------------------------------------------

Ship it!


Committed r1331528


- Dan


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>         Attachments: 34806.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262590#comment-13262590 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7259
-----------------------------------------------------------

Ship it!


LGTM

- Ryan


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "Henry Saputra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13261953#comment-13261953 ] 

Henry Saputra commented on SHINDIG-1759:
----------------------------------------

Please attach the proposed patch to JIRA
                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13261841#comment-13261841 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7222
-----------------------------------------------------------


Could you please add Brian Lillie to this review?

- Dan


On 2012-04-25 16:14:08, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-25 16:14:08)
bq.  
bq.  
bq.  Review request for Ryan Baxter, Dan Dumont and Stanton Sievers.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SHINDIG-1759) Shindig returns the response that should not be cached

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

Ryan Baxter updated SHINDIG-1759:
---------------------------------

    Fix Version/s:     (was: 2.5.0)
                   2.5.0-beta2
    
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 2.5.0-beta2
>
>         Attachments: 34806.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262886#comment-13262886 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------



bq.  On 2012-04-26 14:56:26, BrianLillie wrote:
bq.  > As noted in the JIRA, the issue with the no-cache being returned on the first request, and the (incorrect) cached response on the second request occurs due to the modification of the cached response in the AbstractHttpCache.addResponse.   This code slams the request's refresh interval onto the cache-control headers, and puts that into the cache, while the original request with no-cache is returned to the user.   It seems like this fix would address only one specific issue, that of an incoming request with refresh interval = 0.   If the refresh interval specified  by the client is sufficiently smaller than the time skew between the two servers, wouldn't the same issue occur ?

Hmmm...  

In my experience a max-age on a cache response indicates the maximum period of time before you should toss out the whole cached object and ask again.  Not that you shouldn't ask until you've hit the max-age (which i thought what expires was for).

So should we treat all responses as stale if they come back with max-age so that we can ask with a last-modified query?  I think this is what browsers do.


- Dan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7263
-----------------------------------------------------------


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262654#comment-13262654 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7263
-----------------------------------------------------------


As noted in the JIRA, the issue with the no-cache being returned on the first request, and the (incorrect) cached response on the second request occurs due to the modification of the cached response in the AbstractHttpCache.addResponse.   This code slams the request's refresh interval onto the cache-control headers, and puts that into the cache, while the original request with no-cache is returned to the user.   It seems like this fix would address only one specific issue, that of an incoming request with refresh interval = 0.   If the refresh interval specified  by the client is sufficiently smaller than the time skew between the two servers, wouldn't the same issue occur ?

- BrianLillie


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "Xiao Feng Yu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiao Feng Yu updated SHINDIG-1759:
----------------------------------

    Remaining Estimate: 2h  (was: 2m)
     Original Estimate: 2h  (was: 2m)
    
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13261947#comment-13261947 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7235
-----------------------------------------------------------

Ship it!


LGTM.  This is exactly what I was looking for in our offline conversation.  Thanks.

- Stanton


On 2012-04-25 16:14:08, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-25 16:14:08)
bq.  
bq.  
bq.  Review request for Ryan Baxter, Dan Dumont and Stanton Sievers.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263847#comment-13263847 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7313
-----------------------------------------------------------

Ship it!


LGTM

- Dan


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262325#comment-13262325 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/
-----------------------------------------------------------

(Updated 2012-04-26 02:15:03.180211)


Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.


Summary
-------

Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.


This addresses bug SHINDIG-1759.
    https://issues.apache.org/jira/browse/SHINDIG-1759


Diffs
-----

  http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 

Diff: https://reviews.apache.org/r/4877/diff


Testing
-------


Thanks,

Xiao Feng


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SHINDIG-1759) Shindig returns the response that should not be cached

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

Dan Dumont updated SHINDIG-1759:
--------------------------------

    Attachment: 34806.patch

Attaching patch on behalf of Xiao Feng Yu @ IBM
                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>         Attachments: 34806.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SHINDIG-1759) Shindig returns the response that should not be cached

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

Dan Dumont resolved SHINDIG-1759.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 3.0.0)
                   2.5.0

Committed r1331528
                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 2.5.0
>
>         Attachments: 34806.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13261768#comment-13261768 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/
-----------------------------------------------------------

Review request for Ryan Baxter, Dan Dumont and Stanton Sievers.


Summary
-------

Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.


This addresses bug SHINDIG-1759.
    https://issues.apache.org/jira/browse/SHINDIG-1759


Diffs
-----

  http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 

Diff: https://reviews.apache.org/r/4877/diff


Testing
-------


Thanks,

Xiao Feng


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263151#comment-13263151 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------



bq.  On 2012-04-26 14:56:26, BrianLillie wrote:
bq.  > As noted in the JIRA, the issue with the no-cache being returned on the first request, and the (incorrect) cached response on the second request occurs due to the modification of the cached response in the AbstractHttpCache.addResponse.   This code slams the request's refresh interval onto the cache-control headers, and puts that into the cache, while the original request with no-cache is returned to the user.   It seems like this fix would address only one specific issue, that of an incoming request with refresh interval = 0.   If the refresh interval specified  by the client is sufficiently smaller than the time skew between the two servers, wouldn't the same issue occur ?
bq.  
bq.  Dan Dumont wrote:
bq.      Hmmm...  
bq.      
bq.      In my experience a max-age on a cache response indicates the maximum period of time before you should toss out the whole cached object and ask again.  Not that you shouldn't ask until you've hit the max-age (which i thought what expires was for).
bq.      
bq.      So should we treat all responses as stale if they come back with max-age so that we can ask with a last-modified query?  I think this is what browsers do.

My interpretation of the HTTP 1.1 spec
 - max-age - you are allowed to reuse without validating until the time expires
 - expires - supposed to be deprecated via 1.1 spec, with cache-control taking precedence .. though of course browsers will do what they will
 - no-cache - can't use the response for caching without re-validating with the server first

Based on that, max-age shouldn't be treated as stale until the time expires


- BrianLillie


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7263
-----------------------------------------------------------


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13261954#comment-13261954 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7236
-----------------------------------------------------------


Please do add Shindig as the reviewer to include more people in the community

- Henry


On 2012-04-25 16:14:08, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-25 16:14:08)
bq.  
bq.  
bq.  Review request for Ryan Baxter, Dan Dumont and Stanton Sievers.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 3.0.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHINDIG-1759) Shindig returns the response that should not be cached

Posted by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263860#comment-13263860 ] 

jiraposter@reviews.apache.org commented on SHINDIG-1759:
--------------------------------------------------------



bq.  On 2012-04-27 18:08:34, Dan Dumont wrote:
bq.  > Committed r1331528
bq.  >

Please close this review.


- Dan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4877/#review7314
-----------------------------------------------------------


On 2012-04-26 02:15:03, Xiao Feng Yu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4877/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-26 02:15:03)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and Brian Lillie.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since max-age=0 means the response expires immediately when the response is generated, and there is no need to compute TTL with possibly incorrect server time.
bq.  We can update the isStale method in HttpResponse to return true if max-age equals 0 instead of relying on computed TTL.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1759.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1759
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponse.java 1330087 
bq.  
bq.  Diff: https://reviews.apache.org/r/4877/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Xiao Feng
bq.  
bq.


                
> Shindig returns the response that should not be cached
> ------------------------------------------------------
>
>                 Key: SHINDIG-1759
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1759
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 3.0.0
>            Reporter: Xiao Feng Yu
>              Labels: patch
>             Fix For: 2.5.0
>
>         Attachments: 34806.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> We recently find a issue with Shindig cache. The problem can be happens with the following conditions
> 1) Client perform a makeRequest call with refresh equals 0.
> 2) The clock of web resource server is about 1.5 minutes faster than the clock of Shindig server
> 3) The web resource server returns the resource with Cache-Control header set to no-cache.
> When user A perform a makeRequest call to the web resource, it will get the response correctly, and then the second user B performs the same makeRequest call, Shindig returns the cached response. But in fact, it should not, because refresh equals 0 is specified and Cache-Control: no-cache is present in the response.
> The reason is beause refresh equals 0 will override the cache-control:no-cache header in response with Cache-Control:public,max-age=0 header. And the next time, the cached response retrieved, the TTL of the cached response will be calculated by Date header. And because of the clock skew (Shindig only fix the time drift larger than 3 minutes), it leaves a time window in which the cached response will be returned, while it should not be. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira