Append some random noise to the download URL. See NonCaching image as example.
On Thu, Jul 31, 2014 at 3:24 PM, Entropy <blmulholl...@gmail.com> wrote: > We have an ajax button that submits a form that, if the parameters are > right, > will download an excel file. The developers who wrote the page used an > ajax > behavior and then write the request out as javascript like so: > > target.appendJavaScript((CharSequence) ("window.location.href='" + > getCallbackUrl() + "';")); > > After building the byte array resource and sticking it in place via: > > getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(new > ResourceRequestHandler(rptRS, null)); > > The problem with this is that when a person changes the parameters and > resubmits the form to get a different dynamically generated excel, there's > some caching in play and they get the same one they downloaded earlier. > > We put getResourceSettings().setDefaultCacheDuration(Duration.NONE); in the > application init and it seemed to solve it. But setting to no cache for > the > whole app seems like overkill. We'd like to set it for this one download. > I've seen forum posts that suggest there is a setCacheDuration on some > specific objects, but none of the ones I seem to try. > > How would I set the cache to none for THIS object/URL? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Regards - Ernesto Reinaldo Barreiro