在Wicket DownloadLink上的setCacheDuration

我目前在Wicket中使用downloadLink来允许用户下载一个创build的excel文件,然后被删除。 当这是通过SSL完成IE给我一个错误:“无法下载。

Internet Explorer无法打开此网站。 请求的网站不可用或无法find。 请稍后再试。 “

这里: http : //support.microsoft.com/kb/323308

从上面的微软支持链接看了一些后,似乎是因为它是通过SSL,而我有

response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store"); 

我设置我的downloadLink像这样:

  private void setupDownloadLink() { IModel excelFileModel = new AbstractReadOnlyModel() { public Object getObject() { return excelCreator(); } }; auditDownloadlink = new DownloadLink("auditDownloadlink", excelFileModel); auditDownloadlink.setOutputMarkupPlaceholderTag(true); auditDownloadlink.setDeleteAfterDownload(true); auditDownloadlink.setCacheDuration(Duration.NONE); auditDownloadlink.setVisible(false); findUserForm.add(auditDownloadlink); } However, it seems to work if I do: auditDownloadlink.setCacheDuration(Duration.Minute); 

我想我很困惑这是怎么回事。 setCacheDuration是否意味着文件创build后有多久,在被删除之前是否可用? 或者这是否意味着从声明开始起,文件总共可用多长时间?

在excelCreator()方法中,我调用File excelfile = new File(“Access.xls”); 然后继续处理所有的Excel工作并创build电子表格,然后在我调用的方法结尾:FileOutputStream output = new FileOutputStream(excelfile); workbook.write(输出); output.close();

将我设置的持续时间从我调用的那一刻开始File excelfile = new File(“ssaUserIDAccess.xls”)?

什么是最好的持续时间和设置我应该用于这种情况? 因为文件可能会变得很大,如果文件足够大,可能需要一些时间来创build。

谢谢!

我不记得原因,但是我们在SSL / IE上遇到了同样的问题,我们只需将caching持续时间设置为1秒即可。 只是它不能是无。 另一个我们从未find的解决scheme

 auditDownloadlink.setCacheDuration(Duration.ONE_SECOND)