[
https://issues.apache.org/jira/browse/TUSCANY-2516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624483#action_12624483
]
Dan Becker commented on TUSCANY-2516:
-------------------------------------
I just had a call from Sebastien who proposed several other alternatives in
addition to discussing the ones above.
1) Sebastien proposed some simple requirements on the Tuscany user/implementer
to provide APIs (such as conditionalGet, conditionalPut) that would contain
ETag and LastModified as parameters. Introspection would move the
ETag/LastModified between the HTTP header and the business API conditionalGet.
This is somewhat similar to the current situation where the binding moves the
item ID from the URI to the business API.
2) Another alternative would be a requirement on the Tuscany user/implementer
to implement a Cacheable interface on the business data. This Cacheable
interface would have getID/getETag and getUpdated/getLastModified methods on
the business data. The attractive piece of this idea is that the existing code
for binding-atom-abdera (which uses Feed and Entry to provide ID and Update
elements) would be entirely similar to this new code.
In addition to the above idea, we discussed the drawbacks of implementing these
features as a Java method annotation as proposed in the comments above
(@HTTPRequestCache). Basically, an implementer would mark a method with this
annotation, but they would have to call a conditionalGet method as in item 1
here. Two pieces of work instead of one.
We also discussed the idea of implementing a cache policy on the Java
implementation. Again it appears that the Tuscany user in this case would be
forced to add a policy notation, and then implement it. We viewed this as two
pieces of work instead of one.
Other ideas are welcome. Personally, I am leaniing toward method 2 (Cacheable
interface on business object) as the easiest and fewest requirements on the
Tuscany user of caching.
> HTTP binding should support etag and if-modified headers
> --------------------------------------------------------
>
> Key: TUSCANY-2516
> URL: https://issues.apache.org/jira/browse/TUSCANY-2516
> Project: Tuscany
> Issue Type: Wish
> Components: Java SCA Misc Binding Extensions
> Reporter: Jean-Sebastien Delfino
> Assignee: Dan Becker
> Fix For: Java-SCA-Next
>
>
> The HTTP binding currently does not support etag and if-modified headers for
> implementation-resource and implementation-widget components, preventing Web
> browsers to do any caching.
> Supporting etag and if-modified should be easy for the above component
> implementation types, just a matter of calculating a checksum and use it as
> etag or checking the timestamp of the served file.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.