So let me summarize.

1) The NO_CACHE RenderParam does not appear to affect makeRequest.  From what 
I’ve seen this would require a patch to io.js (as suggested at 
http://markmail.org/message/535kwx47svi626om).  I’ve found several projects 
that branch from shindig that have applied this patch.

2) Ideally it would be nice to do this on a per request basis with a new 
RequestParameters.NO_CACHE flag.  Nuxeo did this.  
http://hg.nuxeo.org/nuxeo/nuxeo-features/rev/46feb3f6ce5e

3) When doing an OUTH2 flow the first request to the service that returns the 
oauthApprovalUrl probably shouldn’t be cached or set in the staleResponse, 
because then it could possibly be used on the response for the ACTUAL request 
if it returns a 500 (my scenario).  Thus an endless loop of display the 
approval url and making the service call.

For now I am using my patched RequestPipleline which turns off caching for all 
oauth2 request.

    public HttpResponse execute(HttpRequest request) throws GadgetException {
        if (request.getAuthType() == AuthType.OAUTH2) {
            request.setIgnoreCache(true);
        }
        return super.execute(request);
    }

I can submit a patch for 1 or 2 (or both) if it’s agreed that’s desired 
functionality.  For #3 it might be outside my shindig knowledge scope, but I 
can try.

doug


On Aug 21, 2014, at 10:56 AM, Davies,Douglas <davi...@oclc.org> wrote:

> I found this issue
> 
> http://markmail.org/message/535kwx47svi626om
> 
> I wonder if this is my issue as well.  I am setting the nocache (even 
> appended &nocache=1 to my service call) and it still doesn’t work.
> 
> It really would be nice I could specify NO_CACHE on the RequestParameters.  
> Or is the Pipeline changes I suggested earlier (only for the oauth2 flow) the 
> right way to go?
> 
> doug
> 
> On Aug 21, 2014, at 9:58 AM, Davies,Douglas <davi...@oclc.org> wrote:
> 
>> Stanton,
>> 
>> Thanks for pointing me in the right direction.  It does appear I have a 
>> problem with my NO_CACHE setting.
>> 
>> I do the following when rendering the gadget.
>> 
>>      renderParams[osapi.container.RenderParam.NO_CACHE] = true;
>>      container.navigateGadget( gadgetSite, gadget.appUrl, {}, renderParams, 
>> function(gadgetInfo)
>> 
>> However I’m not seeing it set in MakeRequestHandler.java where it does
>> 
>>   req.setIgnoreCache("1".equals(getParameter(request, 
>> Param.NO_CACHE.getKey(), null)));
>> 
>> Looking into this.  From looking at the code it does seem like all this 
>> staleResponse and caching mumbo-jumbo should be bypassed if I get this set 
>> right.
>> 
>> Thanks,
>> doug
> 
> 


Reply via email to