[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Indicate entry in Collection Feed is full representation
Teo Hui Ming wrote:
> Hi all, I'm using atompub to publish some light-weight entry
> data. So, it works fine to return a list of entries in a
> feed, where each entry is a complete representation.
>
> When updating an entry, I wish to keep it simple with minimal
> network round trips:
> 0) (assume the client already has the feed)
> 1) client verify an entry in the feed is up-to-date, if not
> retrieve the latest copy.
> 2) client modify the entry and put back to server.
>
> I was thinking of using the 'etag' attribute defined in
> Jame's Link Extensions draft [1]. The idea is to add an etag
> attribute in "edit"
> atom:link, so that a client can perform an If-Non-Match GET
> before start modifying the entry. E.g.,
Problem 1: The entry in the feed might have been up-to-date at the time the feed was generated, but is now out of date. As discussed in previous threads, clients should not expect the feed to be updated immediately each time an entry is added or updated. In particular, a "Cache-Control: max-age=120" on the feed would be totally reasonable for many applications.
Problem 2: The presence of the le:etag attribute does not mean that the entry in the feed is equivalent to the entry retrievable from the link with that attribute. For example, in the feed you could have:
<entry>
<link rel="edit" href="/entries/2" le:etag="xyyz"/>
<summary>Foo</summary>
<entry>
And the entry resource could be:
<entry>
<link rel="edit" href=""/>
<content>Foo Bar</content>
</entry>
Problem 3: Hardly any servers actually implement le:etag.
> But I began to realize, if the current spec states: "Clients
> MUST NOT assume that an Atom Entry returned in the Feed is a
> full representation of an Entry Resource", then what does the
> le:etag attribute in an "edit" atom:link indicate? If the
> client performs an If-Non-Match GET and 304 Not Modified is
> returned, does it mean the entry in the feed is up-to-date,
> hence implying that the entry is a full representation? I
> would like to assume that's true ;-) but I'm not sure.
No, it just means that the entry resource has not changed since the link with the le:etag attribute was made. It doesn't say anything about the entry that contains that link.
> I just need a simple two-step update as mentioned above. So,
> is it fine to use le:etag in this way? or is there another
> way to indicate an entry in a Collection Feed is a full
> representation?
Another mechanism would be needed.
Because the specification says that clients should do a GET on each entry they want to have the full content for, it makes more sense for a server to very briefly summarize the entries in the collection feed and include more entries per page, than it does to have fewer entries per page and the full content of each entry. At least by default.
- Brian