> On May 31, 2013, 9:38 p.m., Ryan Baxter wrote: > > http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/AbstractHttpCache.java, > > line 120 > > <https://reviews.apache.org/r/11584/diff/1/?file=299651#file299651line120> > > > > Will the negative cache ttl value already be set on the response at > > this point?
No. It's done dynamically when you call HttpResponse.isStale() to see if the response is expired. You can see the details further down the call hierarchy from isStale() in HttpResponse.getCacheExpiration(). It ends up that in the case of 401 or 403s, by default, we'll obey the cache-control headers and not use the negative cache ttl. - Stanton ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11584/#review21272 ----------------------------------------------------------- On May 31, 2013, 7:49 p.m., Stanton Sievers wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/11584/ > ----------------------------------------------------------- > > (Updated May 31, 2013, 7:49 p.m.) > > > Review request for shindig. > > > Description > ------- > > org.apache.shindig.gadgets.DefaultGadgetSpecFactory and > org.apache.shindig.gadgets.DefaultMessageBundleFactory utilize a property in > shindig.properties (shindig.cache.xml.refreshInterval) to force the > RequestPipeline/Fetcher layer to cache specs and message bundles for a set > amount of time, regardless of the cache headers on the response. This also > forces the cache ttl in the case that the response is an error instead of > using the "shindig.cache.http.negativeCacheTtl" value in shindig.properties, > which defaults to one minute. > > I'd rather we always use the negativeCacheTtl in this case and ignore the > forced cache ttl. > > This patch addresses that. Do others think this is a good idea? > > > Diffs > ----- > > > http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/AbstractHttpCache.java > 1485016 > > http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/http/AbstractHttpCacheTest.java > 1485016 > > Diff: https://reviews.apache.org/r/11584/diff/ > > > Testing > ------- > > I functionally tested this and also wrote a unit test. All existing unit > tests continue to pass. > > > Thanks, > > Stanton Sievers > >