[ 
https://issues.apache.org/jira/browse/SHINDIG-954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tamil Ramasamy updated SHINDIG-954:
-----------------------------------

    Attachment: patch_SHINDIG-954.zip

I have updated the code to use Response Cache Headers when adding responses to 
Cache. Please find the attached diff files for the same against revision 
754898. 

Could someone please review the changes and commit it to repo? Thanks!

/shindig-apache/java/gadgets/src/main/java

./org/apache/shindig/gadgets/DefaultGadgetSpecFactory.java
./org/apache/shindig/gadgets/http/AbstractHttpCache.java
./org/apache/shindig/gadgets/http/HttpRequest.java
./org/apache/shindig/gadgets/servlet/ProxyHandler.java

Junit test cases Fixed for above changes, 

/shindig-apache/java/gadgets/src/test/java

./org/apache/shindiggadgets/http/AbstractHttpCacheTest.java
./org/apache/shindiggadgets/http/DefaultHttpCacheTest.java
./org/apache/shindiggadgets/http/DefaultInvalidationServiceTest.java
./org/apache/shindiggadgets/render/HtmlRendererTest.java


As you can see in test cases, I had to add 'ETag' in response header to 
identify integrity of HttpResponse from cache. It was previously done by simple 
response string comparison ( including HTTP header + actual content ).

Since AbstractHttpCache.java rewrites response header for cache using 
HttpResponse.getCacheTtl() method and this creates few milliseconds difference 
between the object that was passed and object which is added to cache. Hope 
this explains everything. 

Thanks!

PS: I removed previously attached diff files to avoid confusion.   

> Shindig does not recognize Response Headers for Cache TTL
> ---------------------------------------------------------
>
>                 Key: SHINDIG-954
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-954
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>         Environment: OS: Windows XP / Solaris
> Server: Weblogic
>            Reporter: Tamil Ramasamy
>         Attachments: patch_SHINDIG-954.zip
>
>
> It looks like the cache headers of HTTP requests are not considered for 
> EHCache Cache TTL. However, it is being captured in 
> org.apache.shindig.gadgets.http.HttpResponse, using method getCacheTtl() and 
> getCacheExpiration();
> Please fix it for better usage of Ehcache. Thanks!

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

Reply via email to