There's some redundancy here because both the Preload and the io.makeRequest have to specify a signed fetch. Is there any way to avoid this redundancy? Along those lines, what happens if the Preload is signed but not the makeRequest? An author could easily try to do a preload and yet have it fail for simple reasons.
<Preload href="http://www.myhost.com/getdata" authz="signed" />var params = {}; // forgot "SIGNED" paramIs this makeRequest preloaded or not?
The content of a Preload request is made available to the gadget developer by making the equivalent gadgets.io.makeRequest call on the browser without making a remote call. E.g.
+ 1 on the theoretical side, especially since containers don't have to support the preload (and everything will still work, although with some more latency)
On the practical side: I don't think that the st is sent to shindig at the moment, so preloading a signed request may be difficult. We shouldn't confuse spec with practical implementation though.
Something else: Can we assume that all preloaded content at least allow caching during the lifetime of that single gadget instance? It wouldn't make much sense to preload something that has a no-cache directive...
On Tue, Apr 15, 2008 at 2:38 AM, Kevin Brown <et...@google.com> wrote:On Mon, Apr 14, 2008 at 4:46 PM, Bruno Bowden <br...@google.com> wrote:There's some redundancy here because both the Preload and the io.makeRequest have to specify a signed fetch. Is there any way to avoid this redundancy? Along those lines, what happens if the Preload is signed but not the makeRequest? An author could easily try to do a preload and yet have it fail for simple reasons.
<Preload href="http://www.myhost.com/getdata" authz="signed" />var params = {}; // forgot "SIGNED" paramIs this makeRequest preloaded or not?
The content of a Preload request is made available to the gadget developer by making the equivalent gadgets.io.makeRequest call on the browser without making a remote call. E.g.
<Preload> is already in the spec (and tied to makeRequest) -- the only change Louis is proposing is allowing authentication (something which has been shown to be necessary by most containers). This functionality is purely an optimization.
The need for redundancy is ugly, but I don't see any other way to do it without making backwards compatibility very difficult. Under Louis proposed model, a gadget server that didn't support <Preload> would still work with the gadget, which seems like a pretty big advantage to me, though we would probably want to be explicit and require that the authz used between <Preload> and makeRequest be identical.
--
~Kevin
Doing preloads only for GET requests sounds reasonable.
So long as we're clear in the spec about what is supposed to happen if
a preload is done for GET http://something, and then the gadget does
POST http://something instead. Those are different requests, a
preload for one should not impact the other.
I'd like to propose some amendments to this spec, possibly for 0.8 if people are willing but if not at least for experimental inclusion in Shindig in short-order.
1. Add support for a 'view' attribute which identifies when a Preload should be executed based on which content sections are rendered. This is to allow for different preloads on different views. The value of the attribute is a comma-separated list of views. If the attributes is omitted the preload is always executed
2. Add support for a new authentication mode. SIGNED_OWNER_ONLY. In this situation the viewer information is omitted from the signed request. This is useful when the information returned by the backend does not care about the viewer. A concrete example is a profile view which is non-interactive but shows content that is entirely contextual to the owner. Omitting the viewer from requests for this kind of information allows for significantly better caching throughout the stack Containers which do not implement this mode can fallback to SIGNED.
Perhaps not.
If the container is not exposing viewer information to the gadget under its ACLing rules SIGNED may already not include viewer. It seems SIGNED_OWNER just makes this explicit. Not sure how to interpret SIGNED &user=viewer when viewer isnt accessible?
authz=signed&viewer=false
The signed friends use case would later be handled with
authz=signed&owner-friends=alice,bob,claire
etc...
Cheers,
Brian
I think we need something that is reasonably concise to use in the Preload
XML element and in the JSON bundle for makeRequest
Adding an attribute for possible variant seems verbose but Im willing to go
with it experimentally.
<Preload .... viewer="[true|false]" owner="[true|false]" ..
it is.
I don't think this is the appropriate vehicle to solve the owner-friends
signing problem and folks will just have to wait for the RESTful API for
that.